You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm not sure if this issue belongs here or in sveltejs/rollup-plugin-svelte. I get these warnings if I try to import types from another file:
src/main.ts → public/build/bundle.js...
(!) Import of non-existent export
src/App.svelte
1: <script lang="ts">
^
2: import { TestType } from './types';
3: export let name: string;
The arrow is in the wrong place but that's a different issue. I assume this is happening because it's being treated as a javascript import.
Logs
Please include browser console and server logs around the time this bug occurred.
To Reproduce
Clone the standard template and run the typescript setup script
npx degit sveltejs/template svelte-demo
cd svelte-demo
node scripts/setupTypeScript.js
Add a types file src/types.ts
export interface TestType {
foo: string;
};
import the type in src/App.svelte.
<script lang="ts">
import { TestType } from './types';
export let name: string;
</script>
...
Expected behavior
No warnings.
Information about your project:
Your browser and the version: N/A (issue occurs during build)
Hey @pchynoweth, see the TypeScrpt limitations section in the preprocessing doc. To import a type, you should use the type modifier: import type { ... } from ....
Describe the bug
I'm not sure if this issue belongs here or in sveltejs/rollup-plugin-svelte. I get these warnings if I try to import types from another file:
The arrow is in the wrong place but that's a different issue. I assume this is happening because it's being treated as a javascript import.
Logs
Please include browser console and server logs around the time this bug occurred.
To Reproduce
src/types.ts
src/App.svelte
.Expected behavior
No warnings.
Information about your project:
Your browser and the version: N/A (issue occurs during build)
Your operating system: Arch Linux
svelte-preprocess
version 4.0.10Rollup
package.json
The text was updated successfully, but these errors were encountered: