Closed syabro closed 3 years ago
Solved by adding to webpack config
{
test: /\.m?js/,
resolve: {
fullySpecified: false
}
},
https://github.com/graphql/graphql-js/issues/2721#issuecomment-723008284
(In case if someone would stuck on the same problem)
Thank you for reporting this!
From the attached link I assume you are using Webpack 5, correct?
This is strange, actually, because /storage/
has package.json file inside, with entry point for "module"
, and Webpack should respect it...
I'll try to investigate this.
@yumauri yup, webpack 5.
I've published version 4.0.2, should fix the issue. Didn't try on different bundlers though, but Webpack 5 looks like working fine without any config adjustments. @syabro Can you try new version, please?
@yumauri seems fine. Thanks.
To be sure this case is closed, I tried to make an extended investigation with different popular bundlers. Now I can be at least pretty sure all major bundlers are working fine with my module :)
Bundler | 4.0.2 | 4.0.3 | 4.2.0 |
---|---|---|---|
Webpack 1 (babel 6 loader + es2015 preset + effector/compat) | ✅ | ✅ | ✅ |
Webpack 2 (babel 7 loader + env preset) | ✅ | ✅ | ✅ |
Webpack 3 (babel 7 loader + env preset) | ✅ | ✅ | ✅ |
Webpack 4 | ✅ | ✅ | ✅ |
Webpack 5 | ✅ | ✅ | ✅ |
Parcel 1 | ✅ | ✅ | ✅ |
Parcel 2 | ✅ | ✅ | ✅ |
Rollup | ✅ | ✅ | ✅ |
Snowpack | ✅ | ✅ | ✅ |
esbuild | ✅ | ✅ | ✅ |
FuseBox 3 | ❌ | ✅ | ❌ (👀) |
FuseBox 4 | ✅ | ✅ | ✅ |
Browserify (with require syntax) |
- | ✅ | ✅ |
Poi | - | ✅ | ✅ |
There was an issue with FuseBox 3, it has hardcoded .js
extension to lookup files, so .cjs
files weren't working, and esm weren't working also, I don't know why...
So, I've published version 4.0.3, the only difference is that CommonJS modules now have an extension .cjs.js
In the version 4.2.0 I've decided to change .cjs.js
extensions back to .cjs
. I've tested all bundlers, and everything is working fine, aside from FuseBox3. Which I abandon.