-
Notifications
You must be signed in to change notification settings - Fork 130
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
TypeError: Object is not a function issue when Object message exists in proto file #579
Comments
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: import { MessageType } from '@protobuf-ts/runtime';
import { Object } from '../example';
console.log('Object instanceof MessageType', Object instanceof MessageType);
console.log(Object.create()); |
@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. |
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 |
I was able to reproduce the issue. You can find the application code here: 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? |
Yeah, it looks like a bug with webpack where it seems to incorrectly assume that the in-scope It looks like you might be able to adjust the webpack config to disable the |
Hello everyone, and thank you for this library!
I have encountered an issue with a proto file that includes an "Object" message (yes, I know that is not a good name for the message, but it is what it is). For the sake of simplicity, it looks like this:
When I run my React app which is build with CRA I got this error:
Any ideas how to resolve the issue? Except message renaming :)
I did not have this problem using
protoc-gen-grpc-web
protoc plugin.The text was updated successfully, but these errors were encountered: