-
Notifications
You must be signed in to change notification settings - Fork 70
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
ES modules can't be used in next.js #387
Comments
hi! thanks for raising the issue - does next not support esmodules for the browser dependencies? 🤔 does tree shaking not work there? the babel plugin is commonjs if that changes anything. |
This is also an issue using snowpack. The |
Looks like there are 2 issues. First is that we are shipping mix of es modules and common js modules under import { isNodeEnvironment } from '../is-node';
export var useCache = false ? require('./provider-server').useCache
: require('./provider-browser').useCache;
var Provider = false ? require('./provider-server').default
: require('./provider-browser').default;
export default Provider;
//# sourceMappingURL=index.js.map Secondly, consumers might need to compile use: [
{
loader: 'babel-loader',
},
],
// Exclude the untransformed packages
exclude: /node_modules\/(?!(MODULE1|MODULE2)\/).*/,
... For next.js, there is an open issue for compiling modules under |
Yeah. Let me create another issue to remove the commonjs code split paths. Made here: #405 |
I've been following the project for a while and I'm really excited about the release coming up. I mainly use next.js for most of my projects and would love to play around with this too! Unfortunately, the packages are only bundled as es modules, and while sometimes it works to use next-transpile-modules, it doesn't work with this set of packages.
We use tsdx for a lot of our packages, it could be an easy win to use that here, too!
Thanks so much
The text was updated successfully, but these errors were encountered: