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

Bad problem report in VSCode #107

Closed
scippio opened this issue May 22, 2020 · 3 comments
Closed

Bad problem report in VSCode #107

scippio opened this issue May 22, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@scippio
Copy link

scippio commented May 22, 2020

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

@scippio scippio added the bug Something isn't working label May 22, 2020
@orta
Copy link
Contributor

orta commented May 22, 2020

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

@scippio
Copy link
Author

scippio commented May 22, 2020

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.

@dummdidumm
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants