-
Notifications
You must be signed in to change notification settings - Fork 808
Typescript in .ts files throws error #244
Comments
Do you have any solution for this error @zookini or maybe a workaround? If so please share. I need this error to be gone to properly make progress. |
Try to add
|
I was in the same error, when import
// /src/Component.svelte
<script lang="ts">
import { myScript } from './myScript';
</script> => I resolve the error by add
export default {
// …
plugins: [
// …
typescript({
sourceMap: !production,
inlineSources: !production,
+ rootDir: "./src",
}), But I can't decide its good way or not. Thank you 🙏 |
Can confirm the issue. This really is needed to be fixed! |
Having the same exact issue. Unfortunately adding Removing the resolve plugin as suggested at the top does seem to fix the issue, but I'm too new to javascript to understand the implications of doing that. |
When I try to build with a .ts file containing typescript I get an error e.g.:
This does not seem to happen when I remove
resolve
from plugins, but that obviously introduces an unresolved dependencies issueReproduction
node scripts/setupTypeScript.js
as suggested in docssrc/main.ts
npm run build
Environment
The text was updated successfully, but these errors were encountered: