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

Using "useVitePreprocess: true" and "preprocess({ typescript: false })" causes error for type imports. #1558

Closed
perfStack opened this issue Jul 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@perfStack
Copy link

perfStack commented Jul 12, 2022

Describe the bug

Turning off preprocess({ typescript: false, scss: false }) and turning on experimental: { useVitePreprocess: true, } causes type imports in .svelte files to throw "Unexpected token" error.

Reproduction

Turning on experimental: { useVitePreprocess: true, } and turning off preprocess({ typescript: false, scss: false })

useExperimental
experimental_error

Turning off experimental: { useVitePreprocess: false } and turning on preprocess({ typescript: true, scss: true }) behaves correctly.

no_problem_config
no_error

Expected behaviour

Expected similar behavior between preprocess({ typescript: true }) and experimental: { useVitePreprocess: true, }

System Info

  • OS: Arch linux
  • IDE: VSCode - 1.69.0
  • Svelte for VS Code - v105.18.1

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

@perfStack perfStack added the bug Something isn't working label Jul 12, 2022
dummdidumm added a commit to dummdidumm/language-tools that referenced this issue Jul 26, 2022
…lved

sveltejs#1259
sveltejs#1479
sveltejs#1558

This may give false negatives for people who do not use Vite/forgot to create a svelte.config.js when they use rollup or webpack, but that's likely OK since we can think about these diagnostics as being opt-in: you add a preprocessor config when you want the Svelte warnings, too. Most people who have this problem also likely use TypeScript or a CSS preprocessor. When using TS, errors are caught through the TS intellisense. When using a CSS preprocessor, the only warning they'll miss is the unused CSS warning, which is apparent anyway since those styles are not visible in the browser.
dummdidumm added a commit that referenced this issue Jul 27, 2022
…lved (#1569)

#1259
#1479
#1558

This may give false negatives for people who do not use Vite/forgot to create a svelte.config.js when they use rollup or webpack, but that's likely OK since we can think about these diagnostics as being opt-in: you add a preprocessor config when you want the Svelte warnings, too. Most people who have this problem also likely use TypeScript or a CSS preprocessor. When using TS, errors are caught through the TS intellisense. When using a CSS preprocessor, the only warning they'll miss is the unused CSS warning, which is apparent anyway since those styles are not visible in the browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant