Closed boristian closed 11 months ago
we don't ship a main
entry yet but we probably should!
@boristian try 0.4.3!
Thanks for your quick response.
When using import
I'm still getting the same error.
With
const { jsonSchema } = require('codemirror-json-schema')
I get
Uncaught ReferenceError: exports is not defined at eval (index.js:17:23)
Sorry, 0.4.4 is also not working for me.
@boristian sorry to hear - @imolorhe tried to reproduce the issue with webpack but couldn't - are you able to create a codesandbox that reproduces this bug? i have a hunch that the node version is a factor here
@boristian try the suggested solution here https://github.com/webpack/webpack/issues/11467#issuecomment-691873586
TLDR, add the following to your webpack config:
{
test: /\.m?js/, // maybe change this regex to match codemirror-json-schema specifically e.g. /codemirror-json-schema/
resolve: {
fullySpecified: false
}
}
Thanks for all your help, it woks now!
With version 0.4.4 and adding
{
test: /codemirror-json-schema/,
resolve: { fullySpecified: false }
}
to the webpack rules everything is fine.
Hi, I wanted to try this library but cannot import it.
When I try to import with
But the browser console says:
I am using node 18 with webpack 5.
Am I doing something wrong?
Thanks in advance