[bug] Generated `tsconfig.conf` from `create-tauri-app` for Svelte + Typescript has errors
I created a new Tauri app (2.0) with Svelte and Typescript, but the generated tsconfig.json seems to be extending a tsconfig.json that does not exist (Tauri uses Vite by default).
Output:
user@nodejs:/workspace$ npm create tauri-app@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
> npx
> create-tauri-app
✔ Project name · example
✔ Identifier · com.example.app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, deno, bun)
✔ Choose your package manager · npm
✔ Choose your UI template · Svelte - (https://svelte.dev/)
✔ Choose your UI flavor · TypeScript
Template created! To get started run:
cd noteapp
npm install
npm run tauri android init
For Desktop development, run:
npm run tauri dev
For Android development, run:
npm run tauri android dev
The following setup produces a project with this tsconfig.json:
{
"extends": "./.svelte-kit/tsconfig.json", // <- Does not exist!
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
did you run or build the app (just the frontend is enough) already? The .svelte-kit folder is auto generated. (btw this config should be the same as in svelte-kit's official templates)
same
please ref: https://github.com/tauri-apps/tauri/issues/13017
You need to add this to "scripts": {} in package.json
"prepare": "svelte-kit sync || echo ''",
@phenomen
You need to add this to
"scripts": {}inpackage.json"prepare": "svelte-kit sync || echo ''",
It didn't work either, I tried a few other frameworks, only Svelte didn't display properly
The browser reports an error: Unhandled Promise Rejection: SyntaxError: Unexpected token '='
Then that's something unrelated to this issue here.