Dilden / helth

PWA for tracking nutrients and water
https://helth.app/
GNU General Public License v3.0
7 stars 1 forks source link

Error: Not found: /server/_app/immutable/assets/_layout.d7168494.css #124

Open Dilden opened 1 year ago

Dilden commented 1 year ago

This error shows up during tests. By setting prerender = false; in src/+layout.js, the error will go away but then a new error is shown from the Vite PWA plugin/workbox config.

Besides, the app should be prerenderable except for the one endpoint (src/routes/api/upc/+server.js). That endpoint has since been removed.

Dilden commented 1 year ago

Related issues: https://github.com/sveltejs/kit/issues/10192 https://github.com/sveltejs/kit/issues/10358 https://github.com/sveltejs/kit/issues/7071

Dilden commented 1 year ago

grep -rl _layout.d7168494.css returns the following files which are calling for this "missing file" (the file does exist)

.svelte-kit/cloudflare/sw.js .svelte-kit/output/client/sw.js .svelte-kit/output/server/.vite/manifest.json

Seems like it could be an issue with the Vite-PWA plugin.

jimmyhogoboom commented 8 months ago

This might have been fixed, I don't see any errors when running tests on my end.

Dilden commented 8 months ago

Nah, it's still there. Try running npm run dev to see it happen in the dev server or npm run test to watch it happen with the Integration tests. Unit tests don't need to run a server which is why it wouldn't happen there.

jimmyhogoboom commented 8 months ago

This is all I see when I run npm run dev: image

npm run test has a different error when I run it: image

Dilden commented 8 months ago
  1. With npm run dev, do you see the errors after navigating around the app?
  2. The npm run test error you're seeing is one I have not encountered at all yet. Are all dependencies installed?
jimmyhogoboom commented 8 months ago
  1. My first screenshot was taken after navigating around the app. I tried again to verify, I see the same thing even after visiting every page.
  2. I tried another npm install before npm run test and got the same result. I'll figure it out, though.

Do I need an .env file?

jimmyhogoboom commented 8 months ago

And what Node version are you using?

jimmyhogoboom commented 8 months ago

Ok, I resolved the error in npm run test by updating to the latest LTS version of Node. I was on 20.6.x and I updated to 20.11.x. See: https://github.com/microsoft/playwright/issues/29253#issuecomment-1919137434

Dilden commented 8 months ago
  1. You shouldn't need a .env file for this branch (there is a branch that will but we're not there yet).
  2. Was using Node v20.10 but have upgraded now to v20.11.1. I'm all for using the latest LTS.

I have now upgraded Node via nvm and attempted to remove all Playwright browsers with npx playwright uninstall and reinstall via npx playwright install. I've also cleared the browser cache and I believe this is probably some combination of caching + Vite PWA as it now only refers to /workbox-xxxxxxx.js being Not found in the dev mode. Output shown below: image

Testing still throws errors about files not shown as well. image

I'm inclined to believe the cache isn't being invalidated in both dev and test.

Dilden commented 8 months ago

Deleting /dev-dist/ and re-running npm run dev clears this error in dev mode. It still remains in tests though.