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

Error when newest typescript is installed #144

Closed
julianklose opened this issue Aug 17, 2021 · 3 comments
Closed

Error when newest typescript is installed #144

julianklose opened this issue Aug 17, 2021 · 3 comments

Comments

@julianklose
Copy link

v2.0.1 doesn't work with the newest typescript version.
I saw that plugin has a dependency for typescript:^3.9. With this version everything works but when I update typescript to 4.3.5 I get this error:
--ts_out: TypeError: Cannot read property 'kind' of undefined

v1.0.13 didn't have any problems with typescript 4.

@timostamm
Copy link
Owner

This installs fine for me:

npm init -y
npm i @protobuf-ts/plugin@2.0.1 typescript@4.3.5
curl https://raw.githubusercontent.com/timostamm/protobuf-ts/master/packages/test-fixtures/msg-readme.proto > msg-readme.proto
npx protoc --ts_out . -I . --experimental_allow_proto3_optional msg-readme.proto

node_modules/typescript will be 4.3.5.
node_modules/@protobuf-ts/plugin/node_modules/typescript will be 3.9.10.

Can you provide some details how you encountered this error?

@julianklose
Copy link
Author

I'm using yarn Plug'n'Play:

yarn set version berry
yarn init
yarn add @protobuf-ts/plugin@2.0.1 typescript@4.3.5
curl https://raw.githubusercontent.com/timostamm/protobuf-ts/master/packages/test-fixtures/msg-readme.proto > msg-readme.proto

add script to your package.json: 
"scripts": {"proto": "protoc --ts_out . -I . --experimental_allow_proto3_optional msg-readme.proto"},

yarn proto

@timostamm
Copy link
Owner

The yarn pre-release version gets confused by @protobuf-ts/plugin's typescript peer dependency and updates it's non-peer dependency.

This will likely be fixed before yarn 2.0 is released, but we better drop the peer dependency until then.

Fix is released in @protobuf-ts/plugin@2.0.2. Thanks for the report! Please reopen if you notice something off.

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

2 participants