-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Module not found: Error: Can't resolve 'fs' in '/Users/Saravanan/projects/frontend/widgets/web/node_modules/antlr4' #2852
Comments
Smells like a webpack issue more than an antlr one...
How about checking webpack specs and submitting a PR to update the antlr docs?
Envoyé de mon iPhone
… Le 19 juin 2020 à 17:49, Saravanan Ramupillai ***@***.***> a écrit :
I am using antlr4 with javacript target since years, Now it is throwing error when i do a build using webpack
Module not found: Error: Can't resolve 'fs' in '/Users/Saravanan/projects/frontend/widgets/web/node_modules/antlr4'
It was working fine with webpack-4 with following settings enabled. But now with wbpack-5 it is throwing the error as above.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Browser throws an error require.js:178 GET http://localhost:8888/fs.js 404 (Not Found) CharStreams.js |
@ericvergnaud Maybe it is possible to optionally include char and file stream files? Not to force its inclusion in antlr's index.js if antlr is used on frontend |
Suggest you stick to webpack 4 until webpack 5 provides an equivalent for the below config:
|
hi @saravanan10393 , |
This seems like very unrealistic advice. webpack 5 has been out for an entire year already; I don't think you can tell people "don't upgrade until they fix this problem with our package". I tried adding |
Ah, there is a solution for webpack 5, but for some reason it's not documented here. In your webpack config, add this:
|
@saravanan10393 @kaiyoma @namratha-b if you're on webpack5 could you please try suggestion I added here - #3414 ? Just modify manually package.json file in node_modules/antlr4 and check how it works? |
Next release uses webpack 5, so closing this |
I am using antlr4 with javacript target since years, Now it is throwing error when i do a build using webpack
It was working fine with webpack-4 with following settings enabled. But now with wbpack-5 it is throwing the error as above.
The text was updated successfully, but these errors were encountered: