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

[minor] (!) 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'; #6939

Closed
Bradley-H opened this issue Nov 19, 2021 · 3 comments

Comments

@Bradley-H
Copy link

Bradley-H commented Nov 19, 2021

Describe the bug

When I enable typescript to Svelte Project (not sveltekit)

I get this error

(!) 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';

I've not modified my Main.ts file

import App from './App.svelte';

const app = new App({
	target: document.body,
	props: {
		name: 'world'
	}
});

export default app;

This doesn't prevent it from running, but I'd, ideally like to have my console without errors.

I do have my typescript definition file in my src folder. At first, I thought maybe I should include a .nvmrc file with the recent version, but didn't work. used npm update. That didn't work. So, I imagine this is outside my understanding.

Reproduction

npm run dev

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 Intel(R) Core(TM) i5-10500H CPU @ 2.50GHz
    Memory: 8.58 GB / 15.78 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (95.0.1020.53)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    rollup: ^2.3.4 => 2.60.0
    svelte: ^3.0.0 => 3.44.1

Severity

annoyance

@jasonlyu123
Copy link
Member

possibly duplicate of sveltejs/template#270

Can you check if you're using typescript 4.5 in lock file? if so you might need to downgrade to 4.4

@Bradley-H
Copy link
Author

possibly duplicate of sveltejs/template#270

Can you check if you're using typescript 4.5 in lock file? if so you might need to downgrade to 4.4

yes, I am using typescript 4.5. How do I downgrade to 4.4?

@rmunn
Copy link
Contributor

rmunn commented Nov 19, 2021

How do I downgrade to 4.4?

Try this in your package.json devDependencies.

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

3 participants