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

this.$config isn't typed #386

Closed
avxkim opened this issue Jun 26, 2020 · 5 comments · Fixed by #394
Closed

this.$config isn't typed #386

avxkim opened this issue Jun 26, 2020 · 5 comments · Fixed by #394
Labels
feature request Feature request

Comments

@avxkim
Copy link

avxkim commented Jun 26, 2020

"@nuxt/typescript-build": "^1.0.3",
"@nuxt/typescript-runtime": "^0.4.10",
"nuxt": "^2.13.1",

Cannot use this.$config in a component:

mounted() {
  console.log('current env', this.$config)
}

gives an error about untyped this.$config

@avxkim avxkim added the feature request Feature request label Jun 26, 2020
@WTDuck
Copy link

WTDuck commented Jun 27, 2020

Related issue : nuxt/nuxt#7596

@kevinmarrec
Copy link
Contributor

kevinmarrec commented Jul 1, 2020

@webcoderkz You need to upgrade to latest @nuxt/types which is now equal to nuxt version.

Lot of updates (including documentation) are coming soon !

@avxkim
Copy link
Author

avxkim commented Jul 1, 2020

@kevinmarrec but @nuxt/typescript-build has @nuxt/types already. How can i update @nuxt/typescript-build dependency myself? Isn't its up to you?

@kevinmarrec
Copy link
Contributor

kevinmarrec commented Jul 1, 2020

@webcoderkz Next major version of @nuxt/typescript-build will have the breaking change of not shipping @nuxt/types anymore, users will need to install it on their own to match their nuxt version, so the types are the same version of the framework.

yarn add -D @nuxt/types

is enough to install last version in your project and fix your $config types ;)

@avxkim
Copy link
Author

avxkim commented Jul 1, 2020

Ah, i see now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants