Sage 10 runtime.js issue

This is my first time trying to set up Sage 10. I’ve installed WSL and PHP8, node, nvm, composer and yarn on my ubuntu server.

I had previously set the website up via WAMP (and this is where my DB etc is) but if I visit from localhost - admin all works fine etc - but the frontend I just seem to have an issue with:

file_get_contents(C:\wamp64\www\website/wp-content/themes/sage/runtime.16d785.js): Failed to open stream: No such file or directory

The file however in VS Code does exist, any ideas why this would be?

You’ve got directory separators going both ways in this address, which is wild and potentially part of your problem. I’m not sure where that’s coming from. If you’re using WSL, you shouldn’t be seeing any C:\ file paths–they should all look like /mnt/c/ or something.

So my WP install is via my WAMP. Probably why it’s picking up the windows style path. I’m in the process of installing Apache and mysql server on my WSL but was hoping to not need two envs. Hopefully switching fully to WSL will solve?

Found the info for what Sage 10 needs quite vague in the docs so been looking at some other guides.

I’m having exactly the same issues. Only happens when i run yarn build, NOT on yarn dev.

file_get_contents(C:\wamp64\www\leo_v2/web/app/themes/leo_v2/runtime.16d785.js): failed to open stream: No such file or directory

I too have my site on WAMP.

With the env file of bedrock set to development, the error page shows making the site unusable. I uploaded my site to a web server to test and Query Monitor still reports the file missing there, even with correct address structure.

file_get_contents(/home/myusername/staging.mywebsite.com/web/app/themes/leo_v2/runtime.16d785.js): failed to open stream: No such file or directory

Update: I updated Acorn to v2.0.0-beta.9 and the issue seems to be fixed?

1 Like

I am running into this problem as well:

file_get_contents(/srv/www/project.dev/current/web/app/themes/project/public/js/runtime.js): Failed to open stream: No such file or directory

Brand new M2 Macbook with a fresh Trellis/Bedrock/Sage install.

Watching the project via the dev url. If I make a change to a file, it won’t inject every time, only some times.

I usually have to refresh the browser myself and sometimes when I refresh, I see the issue above.

Now I am at the point where any time I make a save, the browser doesn’t refresh with the updates. If I refresh manually, then I get the above error. If I run yarn build manually, then refresh, the changes appear. I have run that command every time I want to see my changes and then manually refresh.

So, nobody else has this problem? I can’t seem to find any information that leads to a solution to this super annoying issue. Any help would be fantastic, thanks.

1 Like

This is still an ongoing issue for me.

Anytime I save a file and refresh the browser:

file_get_contents(/srv/www/redacted.com/current/web/app/themes/crm/public/js/runtime.js): Failed to open stream: No such file or directory (View: /srv/www/redacted.com/current/web/app/themes/crm/resources/views/layouts/app.blade.php) (View: /srv/www/redacted.com/current/web/app/themes/crm/resources/views/layouts/app.blade.php)

View->render() in [ /srv/www/redacted.com/current/web/app/themes/crm/**index.php** ](file:///srv/www/redacted.com/current/web/app/themes/crm/index.php#L3) (line 3)

1. <?php
2. 
3. echo view(app('sage.view'), app('sage.data'))->render();
4. 

Running yarn build releases the error until next time I save a file.

Did you ever get this solved? Same thing happening to me

1 Like

I have the same issue, I guess it has to do with permissions in the local WP folder but I’m not sure.

I have not. I did perform a fresh install of Bedrock and Sage and started over again. So for so good but it is bound to come up again I almost guarantee. Unfortunately, the errors are too vague for me to figure it out.

The error isn’t vague, it says that the runtime file is missing. That runtime file is generated when you run the build.

You can confirm this behavior yourself:

Run yarn build and then look at the public/js/ directory — there is a hashed runtime file

Run yarn dev and then look at the public/js/ directory — there is a runtime file without a hash