vue-toastification
vue-toastification copied to clipboard
Build error
Versions
- 1.7.14
Describe the bug
When running npm run build
I get this error
ERROR in /home/username/project_path/node_modules/vue-toastification/src/types/index.ts(259,16):
259:16 Invalid module name in augmentation, module '@nuxt/types' cannot be found.
257 | }
258 |
> 259 | declare module "@nuxt/types" {
| ^
260 | interface NuxtAppOptions {
261 | $toast: ReturnType<typeof ToastInterface>;
262 | }
ERROR Build failed with errors.
Your Environment
My package.json file
{
"name": "project",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve"
},
"dependencies": {
"@turf/boolean-point-in-polygon": "^6.5.0",
"@vue/composition-api": "^1.4.9",
"axios": "^0.26.1",
"core-js": "^3.21.1",
"date-fns": "^2.28.0",
"debounce-promise": "^3.1.2",
"image-blob-reduce": "^4.1.0",
"jwt-decode": "^3.1.2",
"ol": "^6.13.0",
"ol-ext": "^3.2.22",
"rambda": "^7.0.3",
"register-service-worker": "^1.7.2",
"ts-loader": "^8.3.0",
"typescript": "^4.6.2",
"vee-validate": "^3.4.8",
"vue": "^2.6.14",
"vue-router": "^3.5.3",
"vue-toastification": "1.7.14",
"vuetify": "^2.6.4",
"vuex": "^3.6.2"
},
"devDependencies": {
"@types/axios": "^0.14.0",
"@types/debounce-promise": "^3.1.4",
"@types/geojson": "^7946.0.8",
"@types/ol-ext": "npm:@siedlerchr/types-ol-ext@^1.7.2",
"@types/pica": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"@vue/cli-plugin-babel": "~4.5.13",
"@vue/cli-plugin-eslint": "~4.5.13",
"@vue/cli-plugin-pwa": "~4.5.13",
"@vue/cli-plugin-router": "~4.5.13",
"@vue/cli-plugin-typescript": "~4.5.13",
"@vue/cli-plugin-vuex": "~4.5.13",
"@vue/cli-service": "~4.5.13",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^7.0.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^4.1.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "1.32.13",
"sass-loader": "^10.0.0",
"vue-cli-plugin-vuetify": "~2.4.8",
"vue-template-compiler": "^2.6.14",
"vuetify-loader": "^1.7.3"
}
}
I did have similar issue like this with this code
import {ToastID} from 'vue-toastification/src/types'
...
// then I used it like this
toastId: 0 as ToastID
The solution for me was just to remove that import, and use
toastId: 0
instead