[SOLVED] Wrapping PC Game In WebPack Throwing 404 Error For Primary Scene

Hello all,

I am wrapping my game, made in Playcanvas in Webpack. When I run the game, I get a 404 error “could not load scene”. This is after downloading the build from the editor with concatenate scripts off. The picture below demonstrates the issue.

Hi @coderMACi5,

What do you mean you are wrapping a pc game in webpack?

I would check the Network tab to see if the assets are loading with the correct url and if they are in place. 404 means the file wasn’t loaded.

@Leonidas thanks for the response. Please check out webpack.js.org. I am aware of what 404 means. However, the scene is in the root directory, same as the index.html file.

Your webpack link doesn’t work. If you are trying to send the webpack project page understood, webpack is a popular build system for web apps…

Excellent project for doing web app development, though can also have a potentially complex configuration to set it properly in place. I’d say try their support forums since this isn’t a Playcanvas related question.

You will have to properly study and understand how it works and what you are targeting to do with it. Basically what is the reason you are wrapping a Playcanvas exported build with webpack and what you are trying to achieve with that.

I just tried the link. It works fine. I don’t know if you remember Koji? @Sean_Thielen had solved an issue I’ve had earlier…

I’m trying to upload my game to Koji. Koji devs have tried to solve the issue, but it wasn’t possible so far. Before, it was throwing an error which said playcanvas-stable.js wasn’t loading, which I solved by using a CDN and not loading it locally. Is there any place I can put the JSON file on the internet, the link of which I can call in index.html?

Yes you forgot initially a dot before .js.org in the webpack link, now it works.

You can definitely put JSON files in any server of yours, configure CORS access to make it accessible from your desired domain/domains. From there you can load it in your app using a simple GET request.

I had tried pastebin before. Any reason why it didn’t work?

I don’t think pastebin is meant to be used as web server for apps to load JSON files. You should normally be using a web hosting service with a propery web server that allows you to serve files.

Could you please give an example? Sorry, haven’t done this kind of thing before.

Also @Leonidas in the networking tab, the app seems to be treating the file as type plain and not json.

Yes because the file wasn’t found in place to be loaded, hence the 404 error.

You should check your urls and make the files available at the url. Before that, it is normal to get a plain served type when getting a 404.

Ok, will check. I’d appreciate it if you could send an example of a hosting site.

For simple HTML/CSS/JS web serving literally anything will do:

https://www.google.com/search?source=hp&q=best%2Bweb%2Bhosting%2Bcompanies&oq=best%2Bweb%2Bhosting%2Bcompanies

Ok. Thanks for you assistance. Am marking as solved.

1 Like