-
Notifications
You must be signed in to change notification settings - Fork 70
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
Turborepo SvelteKit: cannot import TS files from workspace #465
Comments
This doesn't seem to be an rpt2 error as none of the errors you have listed are from rpt2 or from TS.
The TS compiler (and rpt2 as a result) is compatible with both syntaxes and does not give such an error.
This is a Vite config, not a Rollup config. Additionally, I believe SvelteKit is expecting JS and not TS (I believe it uses Vite/ I haven't used Svelte before though, so I can't really help you further than that, but it is pretty clear that it is not an rpt2 bug |
Ok so I updated the example repo with all possible info : https://github.com/MarArMar/TurboSvelteKitTypia
Parse failure: Unexpected token (3:26) Like before, if I remove TS syntax from the TS file it works again. It seems the file is imported as JS The file that loads the other files is TurboSvelteKitTypia\apps\SvelteKitTS\src\routes+page.svelte Tried :
Tried solutions proposed in :
I am becoming really out of ideas and desperate, I would be thankful if you have any clue of what could I try next |
Ok made it work @agilgur5 The issue was I had to add in the config: export default defineConfig({
esbuild: false,
plugins: [
typescript({
include: ["../../**/*.ts+(|x)"],
}),
sveltekit(),
],
}); |
Ah yea, since you're including files outside of the Rollup root, those files would be ignored by default |
Troubleshooting
Reproduction repo: https://github.com/MarArMar/TurboTest
Bug 1: Cannot import TS files (critical because blocks dev)
Note: it seems it imports them as JS because if you remove all TS syntax it works.
The file that loads the other files is TurboSvelteKitTypia\apps\SvelteKitTS\src\routes+page.svelte
Bug 2: Does not find source files (not critical because it does not block dev)
Yes
Environment
Turborepo & Sveltekit
Versions
:rollup.config.js
:tsconfig.json
:package.json
The text was updated successfully, but these errors were encountered: