Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load. #1842

Closed
Tealk opened this issue Jul 25, 2024 · 5 comments
Closed

Failed to load. #1842

Tealk opened this issue Jul 25, 2024 · 5 comments

Comments

@Tealk
Copy link

Tealk commented Jul 25, 2024

Describe the bug

Since update 4.0.0 i get this error:
Failed to load. wasm validation error: at offset 4: failed to match magic number

Browser Console:

Uncaught (in promise) RuntimeError: Aborted(CompileError: wasm validation error: at offset 4: failed to match magic number). Build with -sASSERTIONS for more info.
    BA https://cinny.rollenspiel.chat/assets/index-9U_yHKbS.js:79949
    JA https://cinny.rollenspiel.chat/assets/index-9U_yHKbS.js:79949
index-9U_yHKbS.js:79949:67657
Uncaught (in promise) CompileError: wasm validation error: at offset 4: failed to match magic number index-9U_yHKbS.js line 79949 > WebAssembly.instantiate:79949:1

Reproduction

I use the pre-compiled files and place them on the web server.
I adjust the nginx config
I try to log in.

Expected behavior

No response

Platform and versions

1. OS: Fedora 40 Atomic
2. Browser: Librewolf 128.0-2
3. Cinny version: 128.0-2
4. Matrix homeserver: rollenspiel.chat

Additional context

I use a reverse proxy to forward the public requests to the vserver and I have stored the following nginx config there:

server {
  listen 80;
  server_name cinny.rollenspiel.chat;

  brotli on;
  brotli_static on;
  brotli_comp_level 6;
  brotli_types text/plain text/css text/javascript text/xml application/javascript application/x-javascript application/json application/xml application/xhtml+xm>
  access_log /dev/null;

  root /var/www/cinny;
  index index.html index.htm;

  add_header X-Frame-Options "SAMEORIGIN" always;
  add_header X-Content-Type-Options "nosniff" always;
  add_header X-XSS-Protection "0" always;
  add_header X-Robots-Tag "none" always;
  add_header X-Download-Options "noopen" always;
  add_header X-Permitted-Cross-Domain-Policies "none" always;
  add_header Referrer-Policy "same-origin" always;
  #add_header Expect-CT "enforce, max-age=86400,report-uri='https://anzahreport.uriports.com/reports/report'" always;
  add_header Permissions-Policy "payment=()" always;
  #add_header Content-Security-Policy "default-src 'self' https://rollenspiel.chat;";
  add_header Cross-Origin-Embedder-Policy "require-corp; report-to='default'" always;
  add_header Cross-Origin-Opener-Policy "same-origin; report-to='default'" always;
  add_header Cross-Origin-Resource-Policy "same-origin" always;

  fastcgi_hide_header X-Powered-By;

  location /config.json {
    try_files $uri =200;
  }

  location /manifest.json {
    try_files $uri =200;
  }

  location /olm.wasm {
    try_files $uri =200;
  }

  location /pdf.worker.min.js {
    try_files $uri =200;
  }

  location /public/ {
    try_files $uri =200;
  }

  location /assets/ {
    try_files $uri =200;
  }

  location / {
    try_files $uri /index.html;
  }
}
@ajbura
Copy link
Member

ajbura commented Jul 25, 2024

Can you please try changing location directive as in https://github.com/cinnyapp/cinny/blob/dev/docker-nginx.conf

looks like response code 200 is an issue in your conf

@ajbura
Copy link
Member

ajbura commented Jul 25, 2024

https://cinny.rollenspiel.chat/olm.wasm serves olm.wasm file but when app logs in it request for olm.wasm file from https://cinny.rollenspiel.chat/home/olm.wasm (/home or * any current url) which results in index.html file being served as your location directive is /olm.wasm and not as */olm.wasm

@Tealk
Copy link
Author

Tealk commented Jul 25, 2024

@Tealk Tealk closed this as completed Jul 25, 2024
@viasux
Copy link

viasux commented Jan 11, 2025

Can you please try changing location directive as in https://github.com/cinnyapp/cinny/blob/dev/docker-nginx.conf

looks like response code 200 is an issue in your conf

Would y'all happen to know how to fix this error in caddy? I only use caddy and it seems some of the stuff you're doing in that config isn't covered here: https://caddyserver.com/docs/caddyfile/directives/rewrite

@kfiven
Copy link
Collaborator

kfiven commented Jan 12, 2025

@viasux Just turn on hashRouter by setting enabled = true in config.json. Btw please create a new issue and link old as we do not watch closed issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants