Open
Description
Verify canary release
- I verified that the issue exists in the latest Turborepo canary release.
Link to code that reproduces this issue
Which canary version will you have in your reproduction?
2.4.4
Enviroment information
turbo 2.4.4
CLI:
Version: 2.4.4
Path to executable: ~\turborepo\examples\with-svelte\node_modules\turbo-windows-64\bin\turbo.exe
Daemon status: Running
Package manager: pnpm
Platform:
Architecture: x86_64
Operating system: windows
WSL: false
Available memory (MB): 8794
Available CPU cores: 20
Environment:
CI: None
Terminal (TERM): unknown
Terminal program (TERM_PROGRAM): vscode
Terminal program version (TERM_PROGRAM_VERSION): 1.98.0
Shell (SHELL): unknown
stdin: false
Expected behavior
I would expect packages/{name}/**/*.svelte.ts files getting preprocesses in the same way they do in regular svelte apps.
Actual behavior
✗ Build failed in 313ms
│ error during build:
│ [vite-plugin-svelte-module] [plugin vite-plugin-svelte-module] ../../packages/ui/sample-class.svelte.ts (4:22): ~/turborepo/examples/with-svelte/packages/ui/sample-class.svelte.ts:4:22 `$state(...)` can only be used as a variable declaration initializer or a class field
│ https://svelte.dev/e/state_invalid_placement
│ file: ~/turborepo/examples/with-svelte/packages/ui/sample-class.svelte.ts:4:22
│
│ 2 | export class SampleClass {
│ 3 | constructor() {
│ 4 | this.classState = $state("test");
│ ^
│ 5 | }
│ 6 | // does not work
│
│
│ ELIFECYCLE Command failed with exit code 1.
To Reproduce
Create a ts file in a package with this content:
export const moduleState = $state("test"); // works
export class SampleClass {
public classState = $state("test"); // does not work
}
Additional context
It does work in the app folders