-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
import self issue bug #648
Comments
Can you create a reproduction I can look at? There's no way, from this information you've given me, such behaviour could be replicated. |
when we use ts-node and import , should use .ts > .js |
I disagree. Messing with core node.js expected behaviour is not something I intend to support, and having a behaviour that's different in |
@blakeembrey how about only if xxxx.ts already loaded, than use .ts > .js ? |
That’s still altering the behaviour of node somewhat, I would need to override the module resolution logic. Plus it wouldn’t solve anything really for you - node always loads Javascript first, so you’re just pushing the issue to the second file that’s loaded. You can replicate this by putting a file before your “self import” and it’ll show it only loads the JavaScript and never TypeScript. |
how about make option? |
But why? |
make sure when we run .ts is new sometime when .js, not update done or watcher fail for watch and make new .js |
I still don’t understand why. Can’t you just output JS to a different directory? I think this has negative side effects. For example, this will create an issue for anyone writing JS libraries in TypeScript and publishing them like you are (JS next to TS). The TypeScript will be resolved first and, as a result, won’t be able to compile. Anyone using this flag might run into this random error, creating more issues to triage. |
I want to point out that having @blakeembrey I don't quite understand example above, if there are |
file
./strtable.ts
cli
output
Expected behavior
should only once , even if .js exists
Actual behavior:
will load self x2 ( .js + .ts )
The text was updated successfully, but these errors were encountered: