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

Show details when error occurred during loading test files #27

Open
fisker opened this issue Apr 26, 2022 · 8 comments
Open

Show details when error occurred during loading test files #27

fisker opened this issue Apr 26, 2022 · 8 comments

Comments

@fisker
Copy link
Contributor

fisker commented Apr 26, 2022

It's really useless to show error like this

SyntaxError: Unexpected token '('
    at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
    at async link (internal/modules/esm/module_job.js:42:21)
error Command failed with exit code 1.

I tried a little bit, but seems there is no way to get the full stack.

nodejs/node#49441

@SimenB
Copy link
Contributor

SimenB commented Apr 26, 2022

what I did in #13 (comment) was just run the same file through node itself. not sure if that's feasible here?

@fisker
Copy link
Contributor Author

fisker commented Apr 26, 2022

I did try to run import() on main thread again, but same error. Maybe we can try node <file> to get the error by static import?

@fisker
Copy link
Contributor Author

fisker commented Apr 26, 2022

@SimenB
Copy link
Contributor

SimenB commented Apr 26, 2022

@fisker
Copy link
Contributor Author

fisker commented Apr 26, 2022

Add file name is easy, hard to get line number.

@nicolo-ribaudo
Copy link
Owner

This is really something that should be solved by Node.js itself 😕

@fisker
Copy link
Contributor Author

fisker commented Apr 27, 2022

Implemented #27 (comment) in my module, fisker/esm-utils#294. 😄

@fisker
Copy link
Contributor Author

fisker commented Apr 29, 2022

Finally figured why this trick didn't work, the error comes from import() call in our setup file, that's before runner loading tests.

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

3 participants