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

Asset Path Issues When Building SvelteKit Project with CSS in Production Mode #12689

Open
XIYO opened this issue Sep 19, 2024 · 0 comments
Open

Comments

@XIYO
Copy link

XIYO commented Sep 19, 2024

Describe the bug

Note

Initially, I thought the issue was caused by setting csr=false, but upon further investigation, I've found that the problem lies elsewhere. Please disregard the code in the captured image.

svlete.config.js

const config = {
	kit: {
		inlineStyleThreshold: Infinity,
	}
};

When building the project, the asset paths referenced in the CSS are incorrect. However, everything works fine in development mode.

browser console output:

GET http://localhost:4173/PretendardVariable.CJuje-Rk.woff2 net::ERR_ABORTED 404 (Not Found)

The asset is hashed, but the file name is not being properly mapped to the actual path, which should be _app/immutable/assets/PretendardVariable.CJuje-Rk.woff2. Instead, only the original path is used, and the file name is hashed.

Reproduction

image

https://github.com/XIYO/svelte-hole/tree/master/hole/csr-false

Logs

Error: Not found: /PretendardVariable.CJuje-Rk.woff2 at resolve2 (file:///E:/svelte-hole/hole/csr-false/.svelte-kit/output/server/index.js:3612:18) at resolve (file:///E:/svelte-hole/hole/csr-false/.svelte-kit/output/server/index.js:3445:34) at #options.hooks.handle (file:///E:/svelte-hole/hole/csr-false/.svelte-kit/output/server/index.js:3687:71) at respond (file:///E:/svelte-hole/hole/csr-false/.svelte-kit/output/server/index.js:3443:43) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {status: 404, text: "Not Found", stack: "Error: Not found: /PretendardVariable.CJuje-Rk.wof…jections (node:internal/process/task_queues:95:5)", message: "Not found: /PretendardVariable.CJuje-Rk.woff2"}

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 10.86 GB / 31.93 GB
  Binaries:
    Node: 22.2.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.7.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74), ChromiumDev (127.0.2610.3)
    Internet Explorer: 11.0.22621.3527

Severity

annoyance

@Rich-Harris Rich-Harris transferred this issue from sveltejs/svelte Sep 19, 2024
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

1 participant