We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<pre use:myaction></pre>
After updating svelte from v5.16.5 to v5.16.6 (or the latest v5.17.3), the following code doesn't work anymore:
svelte
<script lang="ts"> import type { Action } from "svelte/action"; const myaction: Action = (element) => { $effect(() => { let code = document.createElement("code"); code.textContent = "Hello world"; element.appendChild(code); }); }; </script> <div> <pre use:myaction></pre> </div>
There is the error:
[vite-plugin-svelte] [plugin vite-plugin-svelte] Cannot read properties of undefined (reading 'type') file: /private/tmp/test-sv2/svelte-pre-issue/src/routes/mypre.svelte TypeError: [plugin vite-plugin-svelte] Cannot read properties of undefined (reading 'type')
It seems that #14922 causes this issue.
Open https://stackblitz.com/github/issueset/svelte-pre-action-issue, and you will see the following error
[plugin:vite-plugin-svelte] Cannot read properties of undefined (reading 'type')
Downgrade the svelte version in package.json to 5.16.5, then everything works fine.
No response
System: OS: macOS 15.1.1 CPU: (8) arm64 Apple M2 Memory: 280.28 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.18.1 - /opt/homebrew/opt/node@20/bin/node npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm pnpm: 9.15.3 - /opt/homebrew/opt/node@20/bin/pnpm bun: 1.1.26 - /opt/homebrew/bin/bun Browsers: Brave Browser: 122.1.63.169 Chrome: 131.0.6778.265 Chrome Canary: 134.0.6947.0 Safari: 18.1.1 Safari Technology Preview: 18.2 npmPackages: svelte: 5.16.6 => 5.16.6
blocking an upgrade
The text was updated successfully, but these errors were encountered:
pre
fix: correctly transform pre with no content (#14973)
9b6e65f
Closes #14971
Successfully merging a pull request may close this issue.
Describe the bug
After updating
svelte
from v5.16.5 to v5.16.6 (or the latest v5.17.3), the following code doesn't work anymore:There is the error:
It seems that #14922 causes this issue.
Reproduction
Open https://stackblitz.com/github/issueset/svelte-pre-action-issue, and you will see the following error
Downgrade the
svelte
version in package.json to 5.16.5, then everything works fine.Logs
No response
System Info
System: OS: macOS 15.1.1 CPU: (8) arm64 Apple M2 Memory: 280.28 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.18.1 - /opt/homebrew/opt/node@20/bin/node npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm pnpm: 9.15.3 - /opt/homebrew/opt/node@20/bin/pnpm bun: 1.1.26 - /opt/homebrew/bin/bun Browsers: Brave Browser: 122.1.63.169 Chrome: 131.0.6778.265 Chrome Canary: 134.0.6947.0 Safari: 18.1.1 Safari Technology Preview: 18.2 npmPackages: svelte: 5.16.6 => 5.16.6
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: