• Hello,

    I have an existing react app that shows up on localhost. However, trying to build the app and opening it up in local wordpress, I see that <div id=”root”></div> is blank.

    I have made sure to change the build script to the following as seen in other posts:
    “build”: “PUBLIC_URL=/wp-content/reactpress/apps/resourcelibrary/build react-scripts build”,

    Do you think you could offer some guidance as to why nothing shows up?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author rockiger

    (@rockiger)

    @523teami The change in package.json looks good. This should work.

    PS: Your link does not work.

    Thread Starter 523teami

    (@523teami)

    Hello,
    Thanks for your reply. I am still having an issue where nothing renders at the root.

    I realized that I am using react-router-dom, so I am wondering if that is supported in your plugin?

    • This reply was modified 2 years, 11 months ago by 523teami.
    Plugin Author rockiger

    (@rockiger)

    Yes it should work. Please go to your /wp-admin/options-permalink.php and click ‘Save Changes’. This will rewrite the permalink cache of your WP installation.

    Does this solve your problem?

    I’m running into the same issue.
    The problem is that when I click on ‘save’ after entering a slug for the page in localWP, It does not do anything, but when I refresh the page I see that the slug has been updated. As a result, the “build” command in package.json file is not updated to include the PUBLIC_URI.
    As a workaround, I manually change the “build” command to the following (I’m on windows):
    "build": "set PUBLIC_URL=/wp-content/reactpress/apps/[appname]/build&&react-scripts build",
    when I build the react-app, the content does not show on [local-WP]/[slug] and the <div id=”root”></div> is blank.
    I’m not very familiar with WP, but if I had to guess, I think that the plugin does not perform all the necessary work when the slug is added for some reason (probably related to using Windows). As I said before, when I click ‘save’, nothing happens.
    I would suggest making a manual integration tutorial, with the necessary changes to the different PHP files and to the react-app files , to be followed in case the automatic tasks are not fully performed for one reason or an other.
    Thank you very much in any case, and I’m looking forward to seeing more tools from you, and hopefully a plugin to integrate nextJS apps as well.
    Kind regards.

    Plugin Author rockiger

    (@rockiger)

    @ryosm

    For whatever reason, the saving process sometimes takes ages. I don’t understand why this is to be honest.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘React App does not show up’ is closed to new replies.