Skip to content
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

Problem with make jslint and thus make test #49130

Closed
martenrichter opened this issue Aug 13, 2023 · 10 comments
Closed

Problem with make jslint and thus make test #49130

martenrichter opened this issue Aug 13, 2023 · 10 comments

Comments

@martenrichter
Copy link
Contributor

Version

current master

Platform

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:

make -s test-doc
Running JS linter...

Oops! Something went wrong! :(

ESLint: 8.46.0

/workspaces/node/tools/node_modules/eslint/node_modules/eslint:1
..
^

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?

That it passes or stop at a meaning full error.

What do you see instead?

See above

Additional information

No response

@benjamingr
Copy link
Member

@martenrichter
Copy link
Contributor Author

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
Copy link
Member

Run make lint?

@martenrichter
Copy link
Contributor Author

This gives the same error message:

root@0faf93d966d2:/workspaces/node# make lint
Running JS linter...

Oops! Something went wrong! :(

ESLint: 8.46.0

/workspaces/node/tools/node_modules/eslint/node_modules/eslint:1
..
^

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 martenrichter changed the title Problem with make test Problem with make jslint and thus make test Aug 13, 2023
@benjamingr
Copy link
Member

benjamingr commented Aug 14, 2023

@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.

I recall Rich posted about it in some old issue

Edit: found it #41771 (comment)

@martenrichter
Copy link
Contributor Author

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!

@benjamingr
Copy link
Member

Happy to help I'm going to go ahead and close this issue. If anyone feels differently feel free to reopen.

@martenrichter
Copy link
Contributor Author

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:


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
Copy link
Contributor Author

Ok, also the new version fails at this line:

var _eslint = _interopRequireWildcard(require("eslint"));

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
Copy link
Member

Please tell me, if this should be investigated more in detail?

No you probably just need to rebuiild, but thanks for offering :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants