antlr4ts
antlr4ts copied to clipboard
Can't resolve 'fs' when using antlr4-c3 package with code completion in angular 7
My grammar file along with the generated lexer, parse and other files are located in the repository and I want to use the code completion feature of c3. But when implementing it I stumbled at the mentioned error
ERROR in ./node_modules/antlr4ts/misc/InterpreterDataReader.js
Module not found: Error: Can't resolve 'fs'
Since angular 6, there is no access to that module since it's client side, so what can be done in my case
Good question, I don't think there should be a reference to module fs
in the main code.
@sharwell, do I remember correctly that the Interpreter... stuff is really only needed for testing?
Actually there is in here and the reference to the fs
module is inside the InterpreterDataReader.js
@BurtHarris the interpreter is also used by certain applications doing non-standard parsing
@tsetsik I think the resolution here is to import specific classes rather than importing all of the runtime through index.ts.
@tsetsik Worked for me
module.exports = {
entry: './index.js',
output: {
path: './',
filename: 'your.bundle.js'
},
node: {
module: "empty",
fs: "empty"
}
};
@tsetsik Worked for me
module.exports = { entry: './index.js', output: { path: './', filename: 'your.bundle.js' }, node: { module: "empty", fs: "empty" } };
There is no option to specify
node: {
module: "empty",
fs: "empty"
}
in webpack-5. What should i do now, i am kind of blocked by this. any suggestion would really helpful.