-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempted import error: 'RTCSessionDescription' is not exported #553
Comments
I get the same error when using |
I had the same error |
I checked what the cause was, and found the following. Tldr; it's due to @libp2p "browser" field in a package.json file Difference between index.jsexport { RTCSessionDescription, RTCIceCandidate, RTCPeerConnection } from 'node-datachannel/polyfill';
//# sourceMappingURL=index.js.map The index.browser.jsexport const RTCPeerConnection = globalThis.RTCPeerConnection;
export const RTCSessionDescription = globalThis.RTCSessionDescription;
export const RTCIceCandidate = globalThis.RTCIceCandidate;
//# sourceMappingURL=index.browser.js.map Lastly, Nextjs 14.2 polyfills states that "to reduce bundle size, Next.js will only load these polyfills for browsers that require them", so if Possible fixes
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack: (config) => {
config.externals.push('node-datachannel/polyfill');
return config;
},
};
export default nextConfig;
|
@adapole thx for looking into this. you are a life saver! |
It seems a related discussion has had no feedback from the next.js team. vercel/next.js#61921 I put out an update for our nextjs-example: ipfs-examples/helia-examples#351 |
FYI: when I remove the Do you all have some special config you're using? This may be solved with |
[email protected] has fixed the error. |
I have no luck writing a ReactJS Hook for Helia. I keep getting the following errors... Any thoughts?
Repro(s)
// version
"helia": "4.2.3",
"next": "14.2.3",
Error
Sample Codes
The text was updated successfully, but these errors were encountered: