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

Sveltekit in a Turborepo Monorepo without ESBuild : can import JS files but not TS files #11105

Closed
MarArMar opened this issue Nov 22, 2023 · 1 comment

Comments

@MarArMar
Copy link

Describe the bug

In this monorepo (https://github.com/MarArMar/TurboSvelteKitTypia), within these Sveltekit projects :

  • ✅ TS files from the same project work
  • ✅ JS file from the PNPM workspace work
  • ✅ On a regular Sveltekit install, TS files on the PNPM workspace work
  • BUT When I import a TS file on the PNPM workspace work I get this :
Parse failure: Unexpected token (3:26)
At file: /@fs/TurboSvelteKitTypia/packages/common/log.ts
Contents of line 3: export const messageLoaded: string =

If I remove TS syntax from the TS file it works again. It seems the file is imported as JS

The file that loads other files is TurboSvelteKitTypia\apps\SvelteKitTS\src\routes+page.svelte

I have no idea if this is a Sveltekit issue specifically or not

Tried :

Tried solutions proposed in :

Reproduction

Reproduction repo : https://github.com/MarArMar/TurboSvelteKitTypia

Setup

pnpm add turbo --global
pnpm install

Sveltekit with Js : working test

Dev

npx turbo run dev --filter=SvelteKitJS

Sveltekit with Ts : not working example

Dev

npx turbo run dev --filter=SvelteKitTS

Logs

Parse failure: Unexpected token (3:26)
At file: /@fs/TurboSvelteKitTypia/packages/common/log.ts
Contents of line 3: export const messageLoaded: string =

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    Memory: 3.48 GB / 15.74 GB
  Binaries:
    Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.8.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Spartan (44.19041.1266.0)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.1
    @sveltejs/kit: ^1.20.4 => 1.27.4
    svelte: ^4.0.5 => 4.2.7
    vite: ^4.4.2 => 4.5.0

Severity

annoyance

Additional Information

No response

@MarArMar MarArMar changed the title Sveltekit in a Turborepo Monorepo : can import JS files but not TS files Sveltekit in a Turborepo Monorepo without ESBuild : can import JS files but not TS files Nov 22, 2023
@MarArMar
Copy link
Author

Managed to make it work with " include: ["../../**/*.ts+(|x)"],"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant