Frame Element: Invariant Violation
See original GitHub issueDescribe 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
id prop, eg: <Element id="text_element">...</Element>.
To Reproduce
- Install Basic project dependencies, and move folders to correct locations
- Import the index.js function export into an existing React Component.
- Error on load
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
Software | Version(s) |
---|---|
craft.js | 0.1.0-beta.13 |
React | 16.12.0 |
TypeScript | none |
Browser | Opera 72.0.3815.320 (Chrome 86) |
npm/Yarn | 6.14.5 |
Operating System | Windows 10 x64 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:14
Top Results From Across the Web
Invariant Violation: Element type is invalid: expected a string ...
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but ...
Read more >Why i get this error "Uncaught Invariant Violation: Frame ...
This function you've defined must run in the render function, and the render function must return all of the output with exactly one...
Read more >invariant violation: tried to get frame for out of range index nan in flatlist
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Read more >Invariant Violation: React.Children.only expected to receive a ...
Coding example for the question Invariant Violation: Invariant Violation: React.Children.only expected to receive a single React element child-React Native.
Read more >Error Invariant Violation registerComponent Target container ...
Uncaught Error: Invariant Violation: _registerComponent(...): Target container is not a DOM element. Here's my code: /** @jsx React.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For me, changing
to
… solved it.
For me this issue arised when trying to have a Container-based component that accepted any children. (No
is
attribute on theElement
tag)What worked for me was to create a “constraint” anyway, and use that.
For example:
Usage:
<Element canvas id="sth" is={Anything}>