-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.documentationImprovements or additions to documentationImprovements or additions to documentationfeature requestNew feature or requestNew feature or request
Description
Describe the bug
import type syntax causes a type error. This is needed for ESM-sensitive bundlers that need to differentiate types from values for erasure during compilation
To Reproduce
Steps to reproduce the behavior:
// svelte.config.js
const preprocess = require("svelte-preprocess")
module.exports = {
preprocess: [
preprocess.postcss(),
preprocess.typescript({ transpileOnly: true }),
],
}// types.ts
export type Secret = string<!-- Component.svelte -->
<script lang="ts">
import type { Secret } from './types' // type error on this line
const secret: Secret = '42'
</script>For example a code snippet that is treated in a way you don't expect.
Expected behavior
Type imports should be parsed without errors
Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):
- OS: Windows 10
- IDE: VSCode
- Plugin/Package: Svelte for VSCode
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.documentationImprovements or additions to documentationImprovements or additions to documentationfeature requestNew feature or requestNew feature or request