-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feedback: Provide more information when there is a SyntaxError #153
Comments
99% of the time is because you are importing a type or interface without the @JakobJingleheimer can your codemod fix this? |
Yes the solution is quite easy and not hard to fix. My point of the issue is that why is this syntax error not stating which file the issue is coming from? If its not amaro, would this be a Node.js loader thing? Where might the best place for this issue be? |
Here is another example:
Like yes I can search-replace here to find where these are, but also its a bit of a chore (and can be misleading) in a large code base. I'd rather these errors just contain the file path at least. |
Yeah those are node core issues, we might have to trim the stacktrace. Amaro just throws an errors, the caller (Node) is responsible for stacktrace. |
Yes, I think so https://github.com/nodejs/userland-migrations/tree/main/recipes/correct-ts-specifiers The publication to codemod is not quite working yet, but you can run it via node like $ node path/to/correct-ts-specifiers/src/workflow.ts You'll need to install correct-ts-specifiers' deps |
For this, you need a different userland-migration (currently WIP): nodejs/userland-migrations#21 |
I'm working on migrating a large JS/TS repo to using Node.js v23 type-stripping. I've already applied some codemods to transform requires & imports, as well as remove TS specific syntax. I'm now running into some syntax errors regarding missing exports which I think were silently being ignored previously. The error does not say what file it is coming from and that is proving difficult to track down. Can amaro print that info? Thank you!
For example:
The text was updated successfully, but these errors were encountered: