Skip to content
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

Invariant Violation Target container is not a DOM element in Parcel project #2087

Closed
AWolf81 opened this issue Jun 23, 2019 · 5 comments
Closed
Labels
🎒 Bundler Refers to CodeSandbox's In-Browser Bundler

Comments

@AWolf81
Copy link

AWolf81 commented Jun 23, 2019

🐛 bug report

Description of the problem

I'm getting an error message "Invariant Violation Target container is not a DOM element" for a Parcel project that I'm loading from Github. Not sure if it's related to my project setup.

#1737 looks related

After page load I'm getting that error message. Once I've edited a script file the preview reloads and it's rendering correctly.

How has this issue affected you? What are you trying to accomplish?

Preview is not usable after page load.

Link to sandbox: https://codesandbox.io/s/github/AWolf81/use-counter-hook-demo

Your Environment

Software Name/Version
Сodesandbox PROD-1561199685-a102c8493
Browser Firefox 67.0.4 (64-Bit)
Operating System Windows 10 Pro (64bit)
@lbogdan
Copy link
Contributor

lbogdan commented Jul 11, 2019

Hey @AWolf81 ,

Our parcel bundler expects index.html to be in the project's root - although we should probably look for it in src as well. Here's exactly the same (working) project, forked from that github repo and with index.html copied from src to /: https://codesandbox.io/s/use-counter-example-qlzgk .

@lbogdan lbogdan added bug? 🎒 Bundler Refers to CodeSandbox's In-Browser Bundler labels Jul 11, 2019
@AWolf81
Copy link
Author

AWolf81 commented Jul 12, 2019

@ibogdan thanks, I'll change the index.html location to the root folder. I think that's OK for the demo but it would be great to also have Codesandbox working with the file in src location.

A better error message would be good if that's possible. As I haven't seen that the location of the file is the problem.

@lbogdan
Copy link
Contributor

lbogdan commented Jul 12, 2019

Well, taking a better look at this, as far as parcel is involved, src is just an arbitrary folder with no special meaning. What we can do, though, is to look for an .html file in the main property of package.json.

As a side-note, explicitly loading the HTML also works: https://niclu.codesandbox.io/src/index.html .

@github-actions
Copy link

github-actions bot commented Sep 4, 2020

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

@github-actions
Copy link

This issue has been automatically closed because there wasn't any activity after the previous notice or the stale label wasn't removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎒 Bundler Refers to CodeSandbox's In-Browser Bundler
Projects
None yet
Development

No branches or pull requests

3 participants