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

Svelte 5 next.179 breaks css on page navigation HMR #12381

Closed
mrxbox98 opened this issue Jul 10, 2024 · 10 comments
Closed

Svelte 5 next.179 breaks css on page navigation HMR #12381

mrxbox98 opened this issue Jul 10, 2024 · 10 comments
Milestone

Comments

@mrxbox98
Copy link

mrxbox98 commented Jul 10, 2024

Describe the bug

All css stops working on a page navigation in next.179. I upgraded from 175 (which was working) and this error appeared. Reverting to 175 worked properly. I use tailwindCSS. Nothing of importance was in the console.

The bug only occured in dev mode.

Reproduction

I couldn't figure out how to have page navigation svelte.dev.

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 9 5900HX with Radeon Graphics        
    Memory: 11.03 GB / 31.42 GB
  Binaries:
    Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.8.0 - ~\AppData\Local\pnpm\pnpm.EXE
    bun: 1.1.9 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (126.0.2592.87)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    svelte: 5.0.0-next.179 => 5.0.0-next.179

Severity

blocking an upgrade

@shinokada
Copy link

shinokada commented Jul 10, 2024

Some of my Runes project are broken. 178 works but 179 breaks them.

Uncaught (in promise) TypeError: e.getAttribute is not a function

Another error:

Uncaught (in promise) Svelte error: svelte_component_invalid_this_value
The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined

@paoloricciuti
Copy link
Member

Can you provide a minimal reproduction?

@dummdidumm dummdidumm added this to the 5.0 milestone Jul 10, 2024
@pheuter
Copy link

pheuter commented Jul 10, 2024

I believe this might be related to an outstanding issue with HMR—temporarily disabling it in svelte.config.js fixed various weird issues for me:

const config = {
    compilerOptions: {
        hmr: false
    }
}

@mrxbox98
Copy link
Author

Did some further checking. My project works on next.178 but not 179. Currently working on making a reproduction repo.

@mrxbox98 mrxbox98 changed the title Svelte 5 next.179 breaks css on page navigation Svelte 5 next.179 breaks css on page navigation HMR Jul 10, 2024
@mrxbox98
Copy link
Author

Can you provide a minimal reproduction?

I tried creating a sveltekit app with the same tailwind config, but haven't been able to reproduce the issue yet. Currently attempting in https://github.com/mrxbox98/svelte-css-reproduction.

@jamesst20
Copy link

jamesst20 commented Jul 14, 2024

Hi,

Maybe it's related, but in DEV mode I started getting this error when navigating from page to page.

Capture d’écran, le 2024-07-14 à 00 51 04

My app is using Inertia and I am runing 5.0.0-next.183. It seems this is happening only if I have a dropdown in my page rendered by the library "svelecte": "5.0.0-next.11".

This is only happening on page navigation and not on hard refresh.

Edit: I found one occurence happening also on hard refresh

Capture d’écran, le 2024-07-14 à 01 04 40

@mrxbox98
Copy link
Author

@jamesst20 Does that issue also occur on next.178. The error I'm facing only occurs 179 and onwards.

@mrxbox98
Copy link
Author

I'm no longer encountering this issue with the latest svelte 5 preview.

@jamesst20
Copy link

Me neither!

@ryoppippi
Copy link

ryoppippi commented Oct 5, 2024

I cannot reproduce this issue, but I still got this issue @ the latest next-257

I'm trying to create minimal repro, but here is the link of the page

vim-jp-radio/LP#276
https://bc5543ca.lp-d1f.pages.dev/

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

7 participants