npm create svelte@latest my-svelte-app. Select "SvelteKit demo app" (uses TypeScript features, whereas the Skeleton project does not) and opt for TypeScript.
cd my-svelte-app
Read svelte.config.js, and notice that vitePreprocess is included for TypeScript support (according to SvelteKit docs, this is only included in the template when the user opts for TypeScript):
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;
sst init
Read svelte.config.js, notice that vitePreprocess has been removed:
This error is not observed in the SvelteKit with TypeScript example in the repo at examples/aws-svelte-kit because even though the project is configured with TypeScript, no TypeScript syntax is used.
Steps to reproduce:
npm create svelte@latest my-svelte-app
. Select "SvelteKit demo app" (uses TypeScript features, whereas the Skeleton project does not) and opt for TypeScript.cd my-svelte-app
svelte.config.js
, and notice that vitePreprocess is included for TypeScript support (according to SvelteKit docs, this is only included in the template when the user opts for TypeScript):sst init
svelte.config.js
, notice that vitePreprocess has been removed:npm install
npm run dev
, open webpageThis error is not observed in the SvelteKit with TypeScript example in the repo at
examples/aws-svelte-kit
because even though the project is configured with TypeScript, no TypeScript syntax is used.