-
Notifications
You must be signed in to change notification settings - Fork 62
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
Versioning problems: TypeError: Cannot read private member #intervals #157
Comments
I cannot reproduce this problem. The unit tests just run fine. Can you make a small test project showing the wrong behavior? |
Hmm. I get it everywhere I call core.collectCandidates, but only when yarn resolves to using [email protected] (or > 3.0.4). |
A minimal test project reproducing the error: https://github.com/trygvea/antlr4-c3-issue157 |
I found a simple fix for me: I now use the latest [email protected], AND force antlr4-c3 to use the same version by regenerating the lockfile (or manually editing it). |
Many thanks for that test project! For the lock file: could be another case where using the "^" specifier in package.json causing trouble. I almost entirely banned that from all my projects. And upgrading packages always involves removing the package-lock.json file. |
I agree, except you probably should use the ^ in antlr4-c3 (using antlr4ng@^3.0.1), because you want the user to specify the version, and want antlr4-c3 to use the same. But as far as I see yarn (and possibly npm?) messes this up and uses different versions. |
I get
TypeError: Cannot read private member #intervals from an object whose class did not declare it
at _IntervalSet.addSet (/Users/trygve/prj/antlr/aql-parser/node_modules/antlr4-c3/node_modules/antlr4ng/dist/index.cjs:605:11)
at _CodeCompletionCore.determineFollowSets (/Users/trygve/prj/antlr/aql-parser/node_modules/antlr4-c3/lib/index.cjs:1208:16)
at _CodeCompletionCore.processRule (/Users/trygve/prj/antlr/aql-parser/node_modules/antlr4-c3/lib/index.cjs:1338:25)
at _CodeCompletionCore.collectCandidates (/Users/trygve/prj/antlr/aql-parser/node_modules/antlr4-c3/lib/index.cjs:1063:10)
It seems to be caused by the following version problems:
When using [email protected] together with [email protected] , everything works fine.
When using [email protected] together with [email protected] (or > 3.0.4), the above error occurs.
(antlr4-c3 depends on antlr4ng using "^3.0.1", ie a minor/patch wildcard, so this is a real problem 😄 )
So, the cause is probably either a semver violation in antlr4ng 3.0.5, i.e. a patch version having breaking changes, or that antlr4-c3 uses some internal stuff in antlr4ng, and should use an exact dependency.
Thanks for a great library!
The text was updated successfully, but these errors were encountered: