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
Svelte fails to parse a non-null assertion within a function has a return type annotation
<script lang="ts"> function foo(): string { return ""! } </script>
// works function foo(): string { return "" } // works function foo() { return ""! } // fails function foo(): string { return ""! }
error during build: [vite-plugin-svelte] [plugin vite-plugin-svelte] Cannot read properties of undefined (reading 'startsWith') file: /Users/albert/svelte-bug-3/src/routes/+page.svelte TypeError: [plugin vite-plugin-svelte] Cannot read properties of undefined (reading 'startsWith') at couldBeFixedByCssPreprocessor (file:///Users/albert/svelte-bug-3/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js:111:72) at enhanceCompileError (file:///Users/albert/svelte-bug-3/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js:126:6) at compileSvelte (file:///Users/albert/svelte-bug-3/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js:148:4) at async Object.transform (file:///Users/albert/svelte-bug-3/node_modules/@sveltejs/vite-plugin-svelte/src/index.js:164:20) at async transform (file:///Users/albert/svelte-bug-3/node_modules/rollup/dist/es/shared/node-entry.js:19663:16) at async ModuleLoader.addModuleSource (file:///Users/albert/svelte-bug-3/node_modules/rollup/dist/es/shared/node-entry.js:19879:36) error: script "build" exited with code 1
System: OS: macOS 15.1 CPU: (8) arm64 Apple M1 Pro Memory: 84.80 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm pnpm: 9.7.0 - ~/Library/pnpm/pnpm bun: 1.1.39 - ~/.bun/bin/bun Browsers: Chrome: 131.0.6778.140 Safari: 18.1 npmPackages: svelte: ^5.14.3 => 5.14.3
blocking all usage of svelte
The text was updated successfully, but these errors were encountered:
@Rich-Harris related
Sorry, something went wrong.
Another hotfix that may potentially solve this issue hasn't been released yet. You can track progress here: #14745
If you're inpatient, there's a workaround: #14741 (comment)
Should be fixed now
No branches or pull requests
Describe the bug
Svelte fails to parse a non-null assertion within a function has a return type annotation
Reproduction
Logs
System Info
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: