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

docs(README.md): add troubleshooting tip for syntax errors #1201

Closed
wants to merge 2 commits into from

Conversation

jedwards1211
Copy link

as discussed in #903. I had to search for awhile to find that issue and figure out what was going on, and there were some duplicate issues, so I think it would help people to explain this directly in the README.

as discussed in TypeStrong#903.  I had to search for awhile to find that issue and figure out what was going on, and there were some duplicate issues, so I think it would help people to explain this directly in the README.
@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #1201 (e4ed5e6) into master (82755eb) will not change coverage.
The diff coverage is n/a.

@cspotcode
Copy link
Collaborator

Nice, thanks for writing this up.

We already have this section explaining SyntaxError: https://github.com/TypeStrong/ts-node#syntaxerror
Should your explanation be merged into it?

Should we also explain how to identify the difference between a TypeScript syntax error and a node syntax error? They have different names, so once you know where to look, it's easy and reliable to tell them apart.
I think this may be addressed by merging your additions into the existing SyntaxError section. Perhaps renaming it will also help, something like SyntaxError vs TSError?

@jedwards1211
Copy link
Author

jedwards1211 commented Jan 28, 2021

I don't think SyntaxError vs TSError would be obvious enough, I had completely failed to notice the SyntaxError section because the name of the errors was the last thing on my mind when I stumbled on this issue. I was thinking "tsc accepted the ?., so why doesn't ts-node?" I thought ts-node was somehow invoking an old version of tsc or using the wrong compile options. So I think some version of "Help! My code compiles with tsc, so why doesn't it work with ts-node?" or "Help! Why am I getting syntax errors in ts-node but not tsc?" is more likely for people to find.

And yeah I think it would be good to merge in what I wrote because I'm not sure the existing explanation there would have been enough to make the light go off in my head. "... cannot be fixed by TypeScript or ts-node. These are runtime issues with your code" sounds like it's saying the mistake is in your code itself, not the transpilation settings.

@jedwards1211
Copy link
Author

If nothing else adding Help! to the title would really help, e.g. Help! I'm getting a SyntaxError!, because the Help! catches your eye immediately when you're looking for troubleshooting info.

@jedwards1211
Copy link
Author

Okay I merged my explanation into the syntax error section, see what you think

@cspotcode
Copy link
Collaborator

Thanks, I haven't forgotten about this. I'm also working on creating a documentation website in #1207

I may roll these changes into a dedicated website page about errors and how to interpret them. Not sure yet; it's all a work-in-progress.
https://typestrong.org/ts-node/docs/interpreting-errors

@cspotcode
Copy link
Collaborator

I ended up adding this to the new "Troubleshooting" page: https://typestrong.org/ts-node/docs/troubleshooting#unsupported-javascript-syntax

I'm going to close this to keep the issue tracker tidy, but please feel free to suggest edits or improvements. It's been a while since I've looked at this so I may have neglected something obvious, even if we already discussed it. Thanks again for sending this PR.

@cspotcode cspotcode closed this May 15, 2021
@cspotcode cspotcode added this to the 10.0.0 milestone May 15, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants