jsonnext / codemirror-json-schema

A JSONSchema enabled mode for codemirror 6, for json4 and json5, inspired by monaco-json
https://codemirror-json-schema.netlify.app
MIT License
56 stars 9 forks source link

Module not found - Webpack can't resolve not fully specified paths #93

Closed Aleafan closed 1 month ago

Aleafan commented 2 months ago

Hello, thanks a lot for your work!

I use Webpack v.5.89.0 for bundling and get following errors: image

It was already mentioned in https://github.com/acao/codemirror-json-schema/issues/57 and seems connected to webpack's resolve.fullySpecified rule defaulting to true - https://webpack.js.org/configuration/module/#resolvefullyspecified. Setting fullySpecified to false solves the problem.

But it looks like more correct solution would be to put .js extensions in those imports as it seems to be recommended practice.

acao commented 1 month ago

@Aleafan can you try again with the latest release?

acao commented 1 month ago

in fact, i am 99% sure the latest release will solve this, but let us know if we need to re-open the ticket because our goal is to match the rest of the codemirror 6 ecosystem we now don't include the .js extension, so that should fix this issue

Aleafan commented 1 month ago

Hello, I checked with latest release v.0.7.8 and it still doesn't work without fixing webpack config.

Webpack rule is if you set "type": "module" in package.json then you SHOULD provide the file extension when importing a module in .mjs files or any other .js files.

I guess we need to reopen the ticket.)