• After run yarn build I can’t see any change in the wordpress.
    I’m using bitnami since my wordpress is allocated in aws

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

    (@rockiger)

    But you can see the initial build?

    Thread Starter cafrida

    (@cafrida)

    Yes I can see the buid in the wordpress and any error appears, but the react app didn’t refresh.

    This is the text that appearas when I run npm run build:

    <em>bitnami@----:/opt/bitnami/wordpress/wp-content/reactpress/apps/my-app$ npm run build
    
    > [email protected] build /bitnami/wordpress/wp-content/reactpress/apps/my-app
    > PUBLIC_URL=/wp-content/reactpress/apps/my-app/build react-scripts build
    
    Creating an optimized production build...
    Compiled successfully.
    
    File sizes after gzip:
    
      43.54 kB  build/static/js/main.4a2a4273.js
      1.78 kB   build/static/js/787.28cb0dcd.chunk.js
      541 B     build/static/css/main.073c9b0a.css
    
    The project was built assuming it is hosted at /wp-content/reactpress/apps/my-app/build/.
    You can control this with the homepage field in your package.json.
    
    The build folder is ready to be deployed.
    
    Find out more about deployment here:
    
      https://cra.link/deployment

    And the app directory of reactpress is /opt/bitnami/wordpress/wp-content/reactpress/apps/my-app

    Plugin Author rockiger

    (@rockiger)

    It seems to be react-scripts don’t see the changes of your source code.

    If the first build works and the second doesn’t this shouldn’t have something to do with ReactPress.

    Did you try to delete your build folder and then rebuild the app?

    Thread Starter cafrida

    (@cafrida)

    I created the app directly in the app directory of the reactpress /opt/bitnami/wordpress/wp-content/reactpress/apps/my-app of my wordpress allocated in a was instance, I don’t understand what you mean by first build.. (I have to create it first locally with wordpress in local??)

    Plugin Author rockiger

    (@rockiger)

    First build === initial build. If you say, you can see the React app in your WP page, this app had to be built before, right. This means ReactPress is working.

    Now to reflect changes that you did with the create-react-app dev server in your app, it has to be built again. This updated build has to be uploaded to your WP site.

    I created 2 new videos on how to get started with ReactPress and how to deploy apps. Maybe the make things clearer:


    Thread Starter cafrida

    (@cafrida)

    Thanks for the videos!

    I have my react app working correctly on wordpress in local but when I update my build file to the deployment (I’m using an aws wordpress image) the react app is not shown. I’m using the correct path and I can see the app in the reactpress plugin as a deployment mode.
    Do you know what is happening?

    Plugin Author rockiger

    (@rockiger)

    I am sorry. I don’t know if it is something strange with AWS. Maybe some security measure that you are not allowed to serve javascript files from the apps location?

    But this is just guessing.

    @cafrida – since its mentioned as AWS wordpress image, assuming its a docker image. I am not an expert in AWS terminologies.

    We have faced the similar issue; In local react application was rendered perfectly, but same app when its deployed in docker wordpress image react-app section was not showing.

    In docker image or machine, check the hosts entry ( /etc/hosts) and see where the hosted domain is pointing. From the machine, if PHP is not able to resolve https://domain.com/wp-content/reactpress/apps/yourappname/build/assets-manifest.json it won’t be able to attach the react app into the content page.

    When the reactpress tries to read the asset-manifest.json over the internet using @file_get_contents function for injecting the scripts and css, it may be failing in doing so, this results in not showing the react app.

    The entire logic happening in repr_load_react_app() function under plugins folder ( /wp-content/plugins/reactpress/public/class-reactpress-public.php )

    Plugin Author rockiger

    (@rockiger)

    @hari2981 Thanks for the information. I wasn’t aware of the issues with hosts entries in docker.

    Do you know any general solution with docker images that could be implemented in ReactPress/PHP?

    • This reply was modified 2 years, 8 months ago by rockiger.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Can’t see changes in wordpress after build’ is closed to new replies.