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

Issue when running protoc-gen-ts on windows machine and then building on Azure Linux pipeline #212

Open
simontherry opened this issue Jun 29, 2023 · 3 comments

Comments

@simontherry
Copy link

Hi,

I'm facing an issue where I'm compiling some .proto files using protoc and protoc-gen-ts where the outcome of the .ts file results in an import with backslashes

import * as dependency_5 from "./google\\protobuf\\empty";

Building this on an Azure Linux pipeline causes issues. I was able to fix the issue by altering the index.js source file:

${path.relative(path.dirname(fileDescriptor.name), moduleSpecifier)

to

${path.posix.relative(path.dirname(fileDescriptor.name), moduleSpecifier)

As a result the import is now:

import * as dependency_5 from "./google/protobuf/empty";

I'm wondering is this is the best approach or not, and if this can be fixed in future versions.

Thanks!

@thesayyn
Copy link
Owner

This should now work with the new rust version of protoc-gen-ts. Can you try that?

@EkkoScholtens
Copy link

I'm having the same issue where the file generated on windows have backslashes instead of forward.
import * as dependency_1 from "./google\\protobuf\\empty";

Is there a parameter where we can specify which we want or another way to fix this?

@thesayyn
Copy link
Owner

thesayyn commented Mar 1, 2024

Can you try with the rust implementation? this should be fixed there;

See #255

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

No branches or pull requests

3 participants