-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Cannot find name 'Long' #1071
Comments
hi did you resolve this issue eventually ? got the same issue here. thx |
What worked for me was to add the following method in my app.component.ts (Angular application) declare var require: any export class AppComponent { |
Greetings! I'm pretty sure we fixed this over in #1166. We will look into cutting a release next! |
Hi @JustinBeckwith, thanks for the fix! Do you know when this might make it into a release? |
protobuf.js version: 6.8.4
After generating code using pbjs and pbjs:
node_modules/protobufjs/bin/pbjs --force-long -t static-module -w commonjs -o info.protobuf.js info.proto
node_modules/protobufjs/bin/pbts -o info.d.ts info.protobuf.js
I have included the long and @types/long in my package.json file:
"long": "^4.0.0",
"@types/long": "^4.0.0",
In my tsconfig.json file I have the following:
{ "compileOnSave": false, "compilerOptions": { ... "types": [ "node_modules/long" ], "typeRoots": [ "node_modules/@types", ] }, "include": [ "src/**/*", "src/assets/proto/*.d.ts" ], "files": [ ... ] }
I import the generated typescript file in my component but when I try to compile I get the following error in
info.d.ts: Cannot find name 'Long'
How can I resolve this issue?
Thanks in advance
The text was updated successfully, but these errors were encountered: