Comments (5)
Can you provide more details for how to reproduce this issue (protoc args, tsconfig, etc.)? As far as I know name clashes with global/reserved identifiers is already taken care of and it's totally valid to have an export like: export const Object = new Object$Type();
and import it in other files
import { MessageType } from '@protobuf-ts/runtime';
import { Object } from '../example';
console.log('Object instanceof MessageType', Object instanceof MessageType);
console.log(Object.create());
from protobuf-ts.
@jcready Thank you for your reply. I have this issue in my old project which is quite complex. I will try to create a small demo and let you know.
from protobuf-ts.
Also, if you could show what the "View compiled" (at the bottom of your screenshot) shows that would also help. FWIW it seems like the reported error message shown isn't lining up correctly (e.g. imperfect sourcemap mapping) based on the fact that the line shown doesn't use a runtime Object
identifier at all.
from protobuf-ts.
I was able to reproduce the issue. You can find the application code here:
https://github.com/larscliff/protobuf-ts-object-issue
So far, I've found two ways to work around the problem. Either update the React version to 18 or remove ">0.2%" from the development section in package.json.
I don't know, perhaps there's a better solution?
from protobuf-ts.
Yeah, it looks like a bug with webpack where it seems to incorrectly assume that the in-scope Object
identifier will always be referencing the global Object
class when that isn't the case.
It looks like you might be able to adjust the webpack config to disable the Object(...)
wrapping which is the source of the issue: webpack/webpack#5600 (comment)
from protobuf-ts.
Related Issues (20)
- Enhancement: Generate specialized `mergePartial()` method when `optimize_for = SPEED`
- Decoding protobuf response HOT 8
- RpcError: unexpected response content type: application/grpc HOT 5
- How does grpc-web use Secure Transport
- Whether vue3 ssr is supported? HOT 2
- Why is a descriptor.ts generated? HOT 5
- Serializing stream to binary. HOT 2
- How to set limited headers in CORS? HOT 5
- TypeScript linting/compiler issues with generated client HOT 2
- Add RpcOptions to Client-Stub constructor? HOT 6
- unused parameters in the empty.ts are causing TypeScript check errors HOT 6
- Global `Object` is not referenced when there is a message named Object. HOT 2
- Proto2 required fields are not serialized when they are the default value HOT 3
- Is this compiling error could be turned off by Typescript or Option in protobuf-ts HOT 2
- 2.9.2 not working with 'exactOptionalPropertyTypes: true' HOT 1
- Release 2.9.3 breaks serialization for me HOT 6
- Generated message classes cannot be subclassed because of missing 'export' HOT 1
- Error decoding from binary: "cant skip wire type 4" HOT 1
- How to debug INVALID_ARGUMENT? HOT 1
- Missing headers on RPCError HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf-ts.