Skip to content
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

Can't resolve 'process/browser' when using @codemirror/lang-xml #529

Open
danieleperilli opened this issue Dec 1, 2024 · 2 comments
Open

Comments

@danieleperilli
Copy link

I'm struggling with an error with the library @codemirror/lang-xml. After I add it to my visual, I start receiving this error during compilation:

ERROR in ./node_modules/@lezer/lr/dist/index.js 1039:23-30
Module not found: Error: Can't resolve 'process/browser' in '<PATH>/node_modules/@lezer/lr/dist'
Did you mean 'browser.js'?
BREAKING CHANGE: The request 'process/browser' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

I found several solutions that involve adding a custom configuration to webpack.config.js, which we can't do, right?
Do you have any suggestions?
Thanks!

@AleksSavelev
Copy link
Contributor

Hi @danieleperilli

Here are a few possible solutions:

  1. You can create your own tools using the webpack-plugin.
  2. Since this repository is open-source:
    a) You can fork it and address the issue if it’s specific to your use case.
    b) Alternatively, you can submit a Pull Request with a fix, and we’ll review and merge it if everything checks out.

If none of these options work for you, it would be helpful to see the source code that reproduces the issue. This would allow us to debug and address it in the future.

@danieleperilli
Copy link
Author

Hi @AleksSavelev,

Thanks for you reply. TBH, I don't want to create a separate tool just for this. I prepared a very simple custom visual you can use to reproduce the error. Please take a look at this repo: https://github.com/danieleperilli/test-custom-visual-with-cm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants