-
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
TypeScript imports broken since use of ProtoScript #202
Comments
@zolex Thanks for reporting this. This change is intentional, and was made specifically to support the TypeScript compiler. The full extension path is expected — it’s required for ES modules which don’t implicitly assume a js extension like commonjs does. The TypeScripts compiler expects js extensions and not ts extensions because the compiler does not manipulate import paths: https://www.typescriptlang.org/docs/handbook/esm-node.html. The TypeScript team may reevaluate this in 4.9. I suspect you're using something other than the TypeScript compiler, such as webpack and ts-loader, to compile your TypeScript code? TypeStrong/ts-loader#1383. @andrewbeckman ran into this as well and reported it in #192. Given this rough edge, I'm open to reevaluating this. |
This could look like the following:
|
That's interesting, thanks for the detailed answer. Our Frontend team is using gatsby, do you know how to address this issue here? |
@zolex I've published https://github.com/tatethurston/TwirpScript/releases/tag/v0.0.64 with the changes I mentioned above. This should "just work" for you -- let me know if you encounter any issues. |
Thanks man, I'll ask our responsible dev on monday to see if it solves the issues. |
since version 0.0.61 when ProtoScript is used by twirpscript to generate typescript code, the imports of the messages from the services are broken:
it outputs .pb.ts files but the import statements are .pb.js
generated files:

import statements before 0.0.61
import statements since 0.0.61
The text was updated successfully, but these errors were encountered: