Cannot access 'Container' before initialization #645
Unanswered
nikitakofman
asked this question in
Q&A
Replies: 1 comment
-
If the code works without Container, the issue might be with it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After going crazy for 10 hours on this problem I am coming for your for help.
My problem is:
Here is my simple custom component from the demo:
Whenever I display it in my editor, no problem, everything works fine, all the tools, etc..
Now I have a 'displayPage' where people can view their site live, which is this one:
Whenever I open this live site, it now gives me the following error:
Unhandled Runtime Error
ReferenceError: Cannot access 'Container' before initialization
Source
src/components/websites/editor-new/selectors/Custom3/index.tsx (34:6) @ Container
32 |
33 | Custom3.craft = {
NOTE: If I remove ...Container.craft, the live site works fine but I lose all the tools in the editor.
There must be some work around or maybe it's something I don't understand about Craft JS...
I have tried everything, if a kind soul can help me out on this I would be extremely grateful.
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions