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

adapter-node return "application/javascript" for mjs instead "text/javascript" #11393

Closed
stalkerg opened this issue Dec 19, 2023 · 6 comments · Fixed by #11419
Closed

adapter-node return "application/javascript" for mjs instead "text/javascript" #11393

stalkerg opened this issue Dec 19, 2023 · 6 comments · Fixed by #11419
Labels
blocked by upstream bug Something isn't working

Comments

@stalkerg
Copy link
Contributor

Describe the bug

For all mjs file adapter node return wrong mime type, because of this Cloudflare can't properly cache it.

Reproduction

Just check header from SvelteKit adapter-node.

Logs

HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Vary: Accept-Encoding
  cache-control: public,max-age=31536000,immutable
  Content-Length: 31277
  Content-Type: application/javascript
  Last-Modified: Mon, 18 Dec 2023 14:45:58 GMT
  ETag: W/"31277-1702910758672"
  Date: Tue, 19 Dec 2023 02:26:36 GMT
  Connection: keep-alive
  Keep-Alive: timeout=5

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (1) x64 AMD EPYC 7542 32-Core Processor
    Memory: 395.87 MB / 861.39 MB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.13.0 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm
  npmPackages:
    @sveltejs/adapter-node: 1.3.1 => 1.3.1 
    @sveltejs/kit: 1.30.3 => 1.30.3 
    @sveltejs/svelte-virtual-list: github:sveltejs/svelte-virtual-list => 3.0.1 
    svelte: 4.2.8 => 4.2.8 
    vite: 4.5.0 => 4.5.0

Severity

serious, but I can work around it

Additional Information

No response

@benmccann
Copy link
Member

node_modules/.pnpm/[email protected]/node_modules/mrmime/index.js:  "js": "application/javascript",
node_modules/.pnpm/[email protected]/node_modules/mrmime/index.js:  "mjs": "application/javascript",

@benmccann
Copy link
Member

Caused by lukeed/mrmime#8

@benmccann benmccann added bug Something isn't working blocked by upstream labels Dec 19, 2023
@stalkerg
Copy link
Contributor Author

@benmccann I tried to update mrmime manually and it didn't help. Anyway, thanks.

@lukeed
Copy link
Member

lukeed commented Dec 20, 2023

released [email protected] w/ the updated values. because MIME value(s) changed, marked this release as breaking

@benmccann
Copy link
Member

Thanks @lukeed. We'll need sirv to use the latest version of mrmime, so I just sent you a PR for that: lukeed/sirv#156

@stalkerg
Copy link
Contributor Author

Thanks, @benmccann and @lukeed !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by upstream bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants