Open m-mujica opened 7 years ago
sure this isn't circular deps?
I did not check for that. Let me see.
Yup, so ParserRuleContext
-> RuleContext
-> antlr/tree/Trees
-> ParserRuleContext
Also, RuleContext
-> tree/Trees
-> RuleContext
Thanks Guys! I'll open a PR to ANTLR4 with the fix. Meanwhile there is some workaround in StealJS?
@asmarques1990 We don't know if this is a bug in Steal.js yet. If you can reduce it down for us that would be awesome. You could either:
a) try to load antlr in Node.js and see if it works there. If the circular dependency is not a problem in Node.js, we have a bug.
b) Instead of testing in node you might also use something like webpack if it works there, then we need to figure out why it does not work in Steal.
Sample code to replicate issue: https://github.com/asmarques1990/stealjs-antlr Reported on https://gitter.im/stealjs/steal?at=5a0c31c671ad3f8736e8d293
while debugging this with @chasenlehara we noticed the problem is in this module:
require('./RuleContext')
returns an empty object when it should not.The weird thing is that
define
is able to load'./RuleContext'
correctly (see line 3345) [arguments[4]
has the things exported by the module]If I step into that
require
it goes through this codeBut
entry.module.exports
is still empty after the link happens.