Wrong import when using `--es_opt=target=ts`
See original GitHub issue👋 Hello,
I’ve noticed a problem when I import a type between my protos while using --es_opt=target=ts
.
in a.proto
:
enum MyEnum {
SOME_VAL = 0;
}
in b.proto
:
import 'a.proto';
message MyMessage {
MyEnum type = 1;
}
and when using
protoc -I proto/*.proto --es_opt=target=ts --plugin=protoc-gen-es=./node_modules/.bin/protoc-gen-es ...
the generated b_pb.ts
contains
...
import {MyEnum} from "./a_pb.js";
...
which is invalid since the file name is of course a_pb.ts
.
I guess it should either generate the import with the .ts
suffix OR just leave it off since that’s valid, too?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Avoiding pylint complaints when importing Python packages ...
Configure pylint. Disabling the wrong-import-position checker in .pylintrc is the simplest solution, but throws away valid warnings.
Read more >Resolve the "Export EXPORT_NAME cannot be updated as it ...
You get this error when one or more stacks are importing an exported output ... Update the importing stack using the modified template....
Read more >Review and troubleshoot import errors
Below, learn how to resolve errors detected during an import, download an error file, view error details, and correct issues in your import...
Read more >Outlook shows a Translation Error during the import of a CSV file
Outlook shows a translation error when you try to import a .csv file in Outlook 2010 or Outlook 2013. This article explains how...
Read more >Fix import errors for audience-specific pages - Atlassian Support
You must be using an audience-specific page to import users. If you are trying to import ... This error means the wrong import...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for this issue and answer! This helps me so much.
I met a similar issue with using Next.js, but this is simply solved by add a resolve rule in webpack. I am leaving this just for next one who came here using Next.js 😃
Add below to
next.config.js
@stephanos I added an example using Jest and esbuild to our connect-web-integration repo here. I actually was able to get things running with mostly the same setup as we have documented, so I think our documentation may be ok.
At any rate, maybe this will provide some help in your issue from last week. I know you mentioned you were working, but just wanted to let you know this was available.