Module not found: 'main/codecs' in '/lerna-monorepo/node_modules/json-url/src/main'
See original GitHub issueI’m trying to use lerna to maintain multiple packages. One of my packages uses json-url npm module and when I tried to run my webpack bundle it gave me this error
Module not found: 'main/codecs' in '/lerna-monorepo/node_modules/json-url/src/main'
the folder structure is lerna-monorepo –node_modules json-url –packages –mypackage <component-using-json-url>
I believe this is due to usage of absolute file referencing in json-url/src/main/index.js
Could you please help me out here
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Error: The specified module could not be found - Stack Overflow
I loaded edge_nativeclr.node in Dependency Walker and noticed that VCRUNTIME140.DLL , the Visual Studio 2015 C runtime, was missing. Edge.js ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for diving into this. My day job has been… busier than usual so it’s been hard to find the time to update the codebase which is admittedly out of date.
I can’t guarantee I’ll have time to work on this, but I’ll keep an eye out for PRs.
I took a pass at updating the import paths in https://github.com/bryanbraun/json-url/commit/611564509c01288c3866d5408ff74400085303db and while that did make
json-url
itself es6 module compatible, I was still running into warnings saying thatjson-url
s dependencies used node-specific features that would need to be polyfilled:That makes me think that if we’re truly going to have a “module” entrypoint in package.json, then it’ll need to point to a module-specific build (perhaps
/dist/module
?) that has been compiled (and polyfilled), similar to the/dist/browser
one.It looks like Webpack has just added support for module builds in v5, so setting that up is probably the best route to getting this working.
The alternative is to revert https://github.com/masotime/json-url/commit/f7d69af322e5baac51a2bc090fb256a95ecb8811, so tools like webpack and snowpack will rely on the browser or node entrypoints instead (as a side-note, another workaround for this issue is to install
"json-url": "2.4.0"
, which was the version before the module entrypoint was added. 😅 )