Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fancy-guests-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/vite-plugin-svelte': patch
---

skip comment blocks when reporting compiler errors that might be caused by a preprocessor issue
3 changes: 3 additions & 0 deletions packages/vite-plugin-svelte/src/utils/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export function enhanceCompileError(err, originalCode, preprocessors) {

let m;
while ((m = styleRe.exec(originalCode))) {
if (m[0]?.startsWith('<!--')) {
continue;
}
// Warn missing lang attribute
if (!m[1]?.includes('lang=')) {
additionalMessages.push('Did you forget to add a lang attribute to your style tag?');
Expand Down