Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Unrecognized option 'defaults' (VS Code) #17

Closed
michaelwooley opened this issue Aug 24, 2020 · 2 comments
Closed

Unrecognized option 'defaults' (VS Code) #17

michaelwooley opened this issue Aug 24, 2020 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@michaelwooley
Copy link

Hi, If I clone this repository I get typehint errors on all svelte files that read:

Unrecognized option 'defaults'

This photo shows how the "error" appears to occur at the top of every file.

image

Curiously, this only appears to be an issue with VS Code typescript extension. No issues/errors are reported when running npm run validate or npm run dev.

To reproduce

git clone https://github.com/babichjacob/sapper-typescript-graphql-template
cd sapper-typescript-graphql-template
npm i
code .

Things I've tried:

  • Setting lang="ts" does nothing
  • Not connected to the <script> tag per se. Just the first character in each file.
  • Remove "defaults" option in sveltePreprocess does nothing.
  • Not seeing anything like this in main svelte/sapper repos so thought I'd check in here first.
@babichjacob
Copy link
Owner

Hi, thanks for your interest in the project and the high quality reproduction steps / attempted solutions; I'm sorry you're experiencing this problem 😦 .

I followed your steps and am not experiencing any errors on macOS 10.15.6 with this VS Code information:

Version: 1.48.1
Commit: 3dd905126b34dcd4de81fa624eb3a8cbe7485f13
Date: 2020-08-19T17:09:41.484Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.6.0

Svelte extension version v101.10.0

Nothing I do seems to start causing an error for me, like adding useless exports to svelte.config.js. I would expect that the defaults export in there is causing your error, but removing it will interfere with your build process — so to prevent that, you'll have to drop the value of defaults in where it's required in rollup.config.js

Maybe there's more information you can learn from the Svelte page in the Output tab (usually alongside Terminal or Problems)?

Here's what mine looks like without errors:
Svelte Output tab

@babichjacob babichjacob added the question Further information is requested label Aug 24, 2020
@babichjacob babichjacob self-assigned this Aug 24, 2020
@babichjacob babichjacob added the bug Something isn't working label Aug 24, 2020
@michaelwooley
Copy link
Author

Aha! Thanks for your quick response @babichjacob ... the problem was rather mundane.

I just needed to fully uninstall the old plugin by JamesBirtles. It looks like he might have removed that plugin when the merge with official happened so it wasn't obvious that it was disabled/running.

code --uninstall-extension JamesBirtles.svelte-vscode

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants