question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Go to definition on Svelte component from ts file takes you to SvelteComponentDev interface

See original GitHub issue

Describe the bug

When you ctrl-click or right-click - Go to definition on a Svelte Component from a ts file you are taken to source code of the SvelteComponentDev Interface

To Reproduce

Create a new ts project:

npx degit sveltejs/template svelte-typescript-app
cd svelte-typescript-app
node scripts/setupTypeScript.js

Open vscode

Open main.ts

in the import App from './App.svelte'; line, ctrlk-click on App or on ./App.svelte

Expected behavior Take you to the App.Svelte file, like what happens when you do it from a .svelte file

Screenshots svelte-vscode-bug

System (please complete the following information):

  • OS: Ubuntu 18.04
  • IDE: vscode
  • Plugin/Package: “Svelte for VSCode”

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
opensascommented, Jul 24, 2020

I suppossed it wasn’t going to be so easy to handle .ts files, just wanted to leave it here in case anybody finds out how to handle it.

BTW, great job, the plugin is marvellous!

0reactions
CoolOppocommented, Mar 8, 2022

I have it enabled in the settings and even added the standalone npm package as a plugin, but I still have the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you import a Svelte component in a Typescript file?
The typescript compiler need to know about ./Component.svelte module. You need to define it. Rollup is a bundler, and it needs to know...
Read more >
Special elements / <svelte:component> • Svelte Tutorial
A component can change its category altogether with <svelte:component> . Instead of a sequence of if blocks... The this value can be any...
Read more >
TypeScript support in Svelte - Learn web development
We'll define a TodoType type to see how TypeScript enforces that anything passed to a component expecting a TodoType will be structurally ...
Read more >
Question about using Svelte component in .ts file : r/sveltejs
svelte '; export const routes = { home: { path: '/', component: Home, } };. The errors are: Type 'typeof SvelteComponentDev' is missing...
Read more >
Why Typescript and Svelte are a match made in heaven
Svelte is an emerging framework for building out front-end components with JavaScript, HTML, and CSS. It's pretty cool on its own, but it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found