rockiger / reactpress

Plugin that lets you easily create, build and deploy React apps into your existing WordPress sites.
https://rockiger.com/en/reactpress/
GNU General Public License v2.0
50 stars 6 forks source link

index.html is empty #42

Closed 3p3p3 closed 1 year ago

3p3p3 commented 1 year ago

Since you added a comment at wordpress-plugin support to post issues here: I think I found one :-).

I tried to get Hot Module Replacment working - but ended up with an error on a blank page at localhost:3000 (Uncaught Error: createRoot(...): Target container is not a DOM element.).

The problem was not a rights-issue but an empty index.html in [my-app-folder]/public/index.html.

I added some code containing <div id="root"></div> Now Hot Module Replacement works!

If that is not a bug but a feature please tell me and I delete this issue.

Thanks again for all that work!

rockiger commented 1 year ago

@3p3p3 This was clearly an issue. Your index.html should resemble your WordPress page where you want to embed your React page.

Unfortunately, ReactPress wrote a blank index.html page if it couldn't reach the WordPress page. This should be fixed in the newest version.

rockiger commented 1 year ago

I am closing this for now. Feel free to re-open it, if the error persists with the newest version.

3p3p3 commented 1 year ago

Works like a charme now :-)