Language-tools: Bad problem report in VSCode

Created on 22 May 2020  ·  3Comments  ·  Source: sveltejs/language-tools

Describe the bug
Error in VSCode, but everything is compiled and functional.
image
The error say: "Module '"/home/scippio/..../src/Test.svelte"' has no default export.ts(1192)"
image

App.svelte

<script type="text/typescript">
    import Test, { getText } from './Test.svelte'

    export let name: string = 'world'
    console.log(Test)
</script>


<h1>Hello {name}! this is: {getText()}</h1>

<Test></Test>

Test.svelte

<script context="module" type="text/typescript">
    export function getText(): string {
        return "getText called..."
    }
</script>
<script type="text/typescript">
    import { onMount } from 'svelte'

    onMount(async () => {
        console.log("Test init...")
    })
</script>

<b>just test</b>

svelte.config.js


// svelte.config.js
const sveltePreprocess = require('svelte-preprocess');

module.exports = {
  preprocess: sveltePreprocess({
    typescript: {
      // transpileOnly: true
      // allowSyntheticDefaultImports: true
    }

    // ...svelte-preprocess options
  }),
  // ...other svelte options
};

Version: 1.46.0-insider
Commit: 6849775440496504e0677ffcf2a46d47ad9130f5
Date: 2020-05-15T05:29:39.210Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.4.40-1-lts

image

bug

All 3 comments

Can you verify this with only "Svelte Beta" installed please? Each one of those extensions will be trying their own thing

it looks like the problem was with "Svelte" extension. when I disabled it the warning disappeared...

image

Tahnk you!
...and I'm sorry it didn't occur to me before I started this issue.

No problem!
Right now Svelte Beta is the official and actively developed plugin. Just "Svelte" is an old version of it - maybe we will take over that one later on and publish an update. Svelte Typechecker was once ahead of Svelte Beta with typescript support but now Svelte Beta does essentially the same thing, and more.
Long story short: you can uninstall "Svelte" and "Svelte Typechecker" for now. Don't forget to reenable script on Svelte Beta afterwards, if you disabled it.

Was this page helpful?
0 / 5 - 0 ratings