improbable-eng / ts-protoc-gen

Protocol Buffers Compiler (protoc) plugin for TypeScript and gRPC-Web.
Apache License 2.0
1.36k stars 173 forks source link

Module not found error while importing from _pb.d.ts file #304

Open Atif-Bashir-1998 opened 2 years ago

Atif-Bashir-1998 commented 2 years ago

I have compiled a porto file fileA.porto using ts-protoc-gen and got two files fileA_pb.js and fileA_pb.d.ts I am trying to import ts class in fileA_pb.ts following this section of documentation: https://www.npmjs.com/package/ts-protoc-gen#:~:text=In%20the%20above%20example%2C%20the%20generated%20folder%20will%20contain%20both%20.js%20and%20.d.ts%20files%20which%20you%20can%20reference%20in%20your%20TypeScript%20project%20to%20get%20full%20type%20completion%20and%20make%20use%20of%20ES6%2Dstyle%20import%20statements%2C%20eg%3A

But this gives an error stating that:

Module not found: Error: Can't resolve 'porto/logic_pd'

I am using Vue 3 with TS and "ts-protoc-gen": "^0.15.0"