godot: Web-exported game - Error: Could not load game data at path '.'. Is the .pck file missing?

Godot version: 8f3fea20 (3.1 branch) + a custom module, built with scons -j2 platform=javascript tools=no target=release CXXFLAGS=--std=c++11

OS/device including version: Windows 7 64-bit, browsers Firefox and Chrome emscripten 64 bit latest (1.38.46)

Issue description: When exporting the game for web and running, I get: Error: Could not load game data at path '.'. Is the .pck file missing?

But if really remove the pck file (to check the suggestion from the message above), I get this instead: Failed loading file 'index.pck': File not found

Export for Windows (same commit, compiled with Visual Studio 2017) runs without the error

Steps to reproduce:

  1. Made a html5 game export
  2. Hosted on local python server (python -m http.server) or itch.io
  3. After game loading bar finished, the browser popped up the error message box

Minimal reproduction project: Any project I tried, including Godot examples

GLES 2 renderer at least, can’t test WebGL 2 on my computer

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Okay I updated my emscripten, and the same Could not load game data at path '.'. Is the .pck file missing error instantly appeared. But I forgot to clean caches, so I’ll need to test it again, because half the code was compiled with an older version. I’ll do it a bit later.

However then I tried the emscripten version from the other issue, and that works, but it turns out this is the proper command to install it from scratch:

.\emsdk.bat install sdk-1.38.27-64bit
.\emsdk.bat activate sdk-1.38.27-64bit

according to the manual anything before 1.38.33 need to be installed like this. (Also sdks older than this should work, I was 2 versions below this originally).

When rebuilding don’t forget to clear your scons cache, emscripten cache, and your build directory from javascript object files like I did first.

Also, I git cleaned, and updated my emscripten install before doing this, just to be safe.

If you are storing your .pck file in github LFS for a web build you must go into index.js and change mainPack from nil to the raw link to your pck file.

@nrcionline Using pre-built Godot 3.1.2? Did you try hosting the game on python server as suggested here https://docs.godotengine.org/en/3.1/getting_started/workflow/export/exporting_for_web.html?

@Calinou Not as far as I can tell

image

The downgrade helped, my game now works in Chrome, but gives just black screen in Firefox. Console output is about the same, hinting the game loaded. Probably there is something wrong with the browser, since Unity games are also black screen.

UPDATE: fixed Firefox black screen in Godot web (and in Unity web) by updating NVidia drivers! Thank you @Relintai

This bug sounds very similar to #32117. Make sure the project name doesn’t contain a dot.

Render buffer and audio context errors have been reported in other issues. Unfortunately, few people are knowledgeable with Emscripten in general, which leads to issues being fixed at a slower pace compared to most other platforms.