You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem with make jslint and thus make test #49130
Linux 0faf93d966d2 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
test linter
What steps will reproduce the bug?
I have set up a dev container with nodejs/devcontainer:nightly .
The git is bound form a windows file system into the container.
When I configure with ninja and run make test, I get:
SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1153:20)
at Module._compile (node:internal/modules/cjs/loader:1205:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object. (/workspaces/node/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
make[1]: *** [Makefile:1364: lint-js-doc] Error 2
make: *** [Makefile:329: test] Error 2
I have made minor modification to js and binary side, but I do not think it is related (#49025).
I know wanted to test changes in the tests to cover the changes and ran into this issue.
I am sorry if it is something stupid, what I forget when setting it up, but I thought using the dev container in VS code should be safe. Thanks!
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Thanks!
Ok, this is how a typical lint error looks with the setup. I was expecting, that it would tell me at least in which file the problem is, since my idea was to use the make test to help me find the lint errors.
SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1153:20)
at Module._compile (node:internal/modules/cjs/loader:1205:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object. (/workspaces/node/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
make[1]: *** [Makefile:1364: lint-js] Error 2
@martenrichter did you run make before running make test? If you didn't make Node will use the system version which may often be incompatible with the code syntax wise.
That old issue looks promising, I will test this soon.
I can not remember if I ran make the last time when I have run make test.
But anyway, the thread will probably have the answer! Thanks!
loading eslint from within its plugin fails in my example. I will now workaround this problem by replacing this one test with another working test.
Please tell me, if this should be investigated more in detail?
Activity
benjamingr commentedon Aug 13, 2023
There is a lint error in your code from #49025 e.g. stuff like https://github.com/nodejs/node/pull/49025/files#diff-ac5af2e03d6e50747ae181d62ebb939ee884b05c70c42aa7297fb7323b3e6639R950 is missing a semicolon
martenrichter commentedon Aug 13, 2023
Thanks!
Ok, this is how a typical lint error looks with the setup. I was expecting, that it would tell me at least in which file the problem is, since my idea was to use the make test to help me find the lint errors.
benjamingr commentedon Aug 13, 2023
Run
make lint?martenrichter commentedon Aug 13, 2023
This gives the same error message:
[-]Problem with make test[/-][+]Problem with make jslint and thus make test[/+]benjamingr commentedon Aug 14, 2023
@martenrichter did you run
makebefore runningmake test? If you didn't make Node will use the system version which may often be incompatible with the code syntax wise.I recall Rich posted about it in some old issue
Edit: found it #41771 (comment)
martenrichter commentedon Aug 14, 2023
That old issue looks promising, I will test this soon.
I can not remember if I ran
makethe last time when I have runmake test.But anyway, the thread will probably have the answer! Thanks!
benjamingr commentedon Aug 14, 2023
Happy to help I'm going to go ahead and close this issue. If anyone feels differently feel free to reopen.
martenrichter commentedon Aug 19, 2023
So thanks to the pointers, I was able to hunt down the cause of the issue. Or let's say I know how to workaround it.
The problem occurs in:
node/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js
Line 8 in d396a04
I have seen, that this line was changed 5 days ago, I will therefore resync my patch with current master and see if it is fixed.
martenrichter commentedon Aug 19, 2023
Ok, also the new version fails at this line:
node/tools/node_modules/eslint/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js
Line 8 in 41a3a1d
loading eslint from within its plugin fails in my example. I will now workaround this problem by replacing this one test with another working test.
Please tell me, if this should be investigated more in detail?
benjamingr commentedon Aug 20, 2023
No you probably just need to rebuiild, but thanks for offering :)