Closed JaviOverflow closed 3 years ago
Doing
const { $http } = useContext() $http.$post(...)
$post is highlighted as not found in type. For some reason, it doesn't find the types for $http.
I'm using "@nuxt/http": "^0.6.2" and included the module in nuxt.config.js like so:
"@nuxt/http": "^0.6.2"
nuxt.config.js
modules: ['@nuxt/http'],
I'm already using other modules and buildModules, and they get their types inferred correctly. I'm not sure how to fix this or what I'm doing wrong.
I'm using the following versions:
// dependencies "nuxt": "^2.15.0", "@nuxt/typescript-runtime": "^2.0.1", "@nuxtjs/composition-api": "^0.20.1", // devDependencies "@nuxt/types": "^2.15.0", "@nuxt/typescript-build": "^2.0.4",
Adding @nuxt/http to the types at tsconfig.json solved the issue. Sorry for opening the issue.
@nuxt/http
tsconfig.json
Doing
$post is highlighted as not found in type. For some reason, it doesn't find the types for $http.
I'm using
"@nuxt/http": "^0.6.2"
and included the module innuxt.config.js
like so:I'm already using other modules and buildModules, and they get their types inferred correctly. I'm not sure how to fix this or what I'm doing wrong.
I'm using the following versions: