-
-
Notifications
You must be signed in to change notification settings - Fork 754
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
Frame Element: Invariant Violation #141
Comments
I'm having the same problem here, tried to reproduce the "simple" example.
My text component:
And finally, my Toolbox:
|
I converted your example into a CodeSandbox without the styling and it works without the error. Are you able to reproduce it in the Codesandbox, or are you able to fix your error by looking at the example? Edit: Maybe there was a mismatch between using |
@ankri Thanks for trying to reproduce the issue, I copied the exact same code from the sandbox, and the problem still happens 😱 Same React version (17), I reinstalled all my node-modules and restarted the app. The only way to not break the app is by removing the I can't think of anything else that could trigger this error.
|
@thiagoterleski see this sandbox that demonstrates where the issue comes from, its basically a safe check for nested Canvas components that don't have a valid id. Please double check that this doesn't happen in your case! |
@matdru Thanks for the example, I was able to fix the problem by removing the hot reload wrapper from my App.js. I was testing the code in different levels in the app and noticed it worked when I tested directly in the index file. Not sure why it would trigger this specific error but it worked after removing it. 🤷♂️ |
Same issue here. Can't get it to work even when using a simple example such as the one @thiagoterleski provided. Edit: I have also tested it with 0.2.0-alpha.16 |
@PalTamasWBA please checkout sandbox above to see what is causing the issue, alternatively if you can provide a small sandbox with your setup we can try to debug. Version 0.2.0 has some breaking changes compared to 0.1.0, but both should be operational and useable. |
@matdru sorry for going off topic but these breaking changes from v0.1.x to 0.2.x are documented somewhere? i see that 0.1.0-beta.11 is considered the stable version, which one is suggested to be used in production? is v0.1 going to be deprecated soon? |
@matdru I have managed to fix it. It turns out indeed this has something to do with hot reloading. It wasn't enough to remove the hot reload wrapper, i also needed to remove the hot flag from the webpack dev server. Did you come across something like this whilst developing the package? |
@PalTamasWBA i don't recall having any issues like that, but to be honest i'm most often using a basic CRA react starter for any development, so i hadn't tested it across other setups. If you are using any specific starter that was giving you these issues, feel free to link it i can try and investigate it further. |
@nicosh We realised there are some unfortunate design choices in internal API's and craft state structures that don't scale too well in the long run, so that's when 0.2.0 was born. I think that's where active development has shifted to these days ( correct me if im wrong @prevwong 😸 ). That being said since a lot of people are currently running their projects on 0.1.0 so we still accept PR's for bug fixes and improvements and it's going to be a while before we deprecate it fully. When we do there will be a migration guide posted and we will try to keep it as simple and straightforward as possible 🤞 |
@thiagoterleski @matdru it's sorted. I had to fix a warning that said "React dom patch not detected" Edit: I'm using |
For me, changing
to
.. solved it. |
For me this issue arised when trying to have a Container-based component that accepted any children. What worked for me was to create a "constraint" anyway, and use that. For example:
Usage:
|
Describe the bug
Invariant violation when running Basic example inside React App. Error occurs on
<Frame>
element and below.Uncaught Error: Invariant failed: A <Element /> that is used inside a User Component must specify an
idprop, eg: <Element id="text_element">...</Element>.
To Reproduce
Expected behavior
The Basic Example's main export is a function component, which should mean it is importable within an existing React App.
Your environment
The text was updated successfully, but these errors were encountered: