Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Typescript support broken with TS 4.5, can't find type declarations #270

Closed
@phaer

Description

@phaer

Hi,

I am trying to create a new svelte project with typescript support, but the build and dev scripts seem unable to find type declarations for App.svelte, even though src/global.d.ts seem to be correct:

/// <reference types="svelte" />

To Reproduce

~/projects 
❯ npx degit sveltejs/template svelte-app
> cloned sveltejs/template#HEAD to svelte-app

~/projects 
❯ cd svelte-app/ && node scripts/setupTypeScript.js
Converted to TypeScript.

~/projects/svelte-app via ⬢ v16.11.1 
❯ npm install && npm run build

added 135 packages, and audited 136 packages in 2s

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> svelte-app@1.0.0 build
> rollup -c


src/main.ts → public/build/bundle.js...
(!) Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module './App.svelte' or its corresponding type declarations.
src/main.ts: (1:17)

1 import App from './App.svelte';
                  ~~~~~~~~~~~~~~

(!) Plugin typescript: @rollup/plugin-typescript: Typescript 'sourceMap' compiler option must be set to generate source maps.
created public/build/bundle.js in 1.3s

Node Version

❯ node --version
v16.11.1
❯ npm --version
8.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions