Title: Update Dev-Environtment button creates empty file
Last modified: July 20, 2021

---

# Update Dev-Environtment button creates empty file

 *  Resolved [nickerzb](https://wordpress.org/support/users/nickerzb/)
 * (@nickerzb)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/update-dev-environtment-button-creates-empty-file/)
 * I followed your directions exactly:
 * 1. Install reactpress plugin
    2. On server, cd into apps directory of plugin 
   3. Run create-react-app script to generate app 4. Add slug to reactpress config
 * At this point, my index.html in the /public folder of my app is cleared, which
   obviously causes the app to fail to load when ran.
 * Any time that I click the `Update Dev-Environment` button in reactpress it also
   clears my index.html entirely.
 * Am I missing something or is this an obnoxious bug?
 * My setup is in docker compose with the following images:
    – Official wordpress
   docker image ([https://hub.docker.com/_/wordpress](https://hub.docker.com/_/wordpress))–
   mysql:5.7

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [rockiger](https://wordpress.org/support/users/rockiger/)
 * (@rockiger)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/update-dev-environtment-button-creates-empty-file/#post-14686487)
 * It looks like, that ReactPress can’t reach the page that gets created.
 * Can you confirm that the page with the page slug can be viewed in WP?
 * The critical line in the code is:
 *     ```
       $file_contents = file_get_contents(site_url() . '/' . $pageslug);
       ```
   
 * If the page gets created and is viewable, it seems that the site_url() function
   doesn’t return the right value.
 * I don’t know if this could be an issue with the docker image. Is using [localWP](https://localwp.com/)
   an alternative for you?
 *  Thread Starter [nickerzb](https://wordpress.org/support/users/nickerzb/)
 * (@nickerzb)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/update-dev-environtment-button-creates-empty-file/#post-14690481)
 * It looks like `site_url()` is a function that is provided by wordpress yeah? 
   Do you know how WordPress resolves this or sets this? I could probably just print
   it out and check too, but if you know offhand that’s probably easier. I’m guessing
   that’s the issue as well. It should have access, as it’s all within the same 
   docker container, but I bet it’s resolving localhost differently.
 *  Thread Starter [nickerzb](https://wordpress.org/support/users/nickerzb/)
 * (@nickerzb)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/update-dev-environtment-button-creates-empty-file/#post-14690499)
 * [https://github.com/docker-library/wordpress/pull/142](https://github.com/docker-library/wordpress/pull/142)
 * This looks like what I need to do. I can provide the current domain/site. I don’t
   think this is your issue, so I’m going to close this.
 * Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Update Dev-Environtment button creates empty file’ is closed to new replies.

 * ![](https://ps.w.org/reactpress/assets/icon-256x256.png?rev=2471443)
 * [ReactPress - Create React App for Wordpress](https://wordpress.org/plugins/reactpress/)
 * [Support Threads](https://wordpress.org/support/plugin/reactpress/)
 * [Active Topics](https://wordpress.org/support/plugin/reactpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reactpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reactpress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [nickerzb](https://wordpress.org/support/users/nickerzb/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/update-dev-environtment-button-creates-empty-file/#post-14690499)
 * Status: resolved