Closed emdahlstrom closed 1 year ago
Unfortunately devs don't follow semantic versioning and they introduces breaking changes in patch releases :fearful:.
@devs Yes, changing core library major version (typescrtipt
3.x -> 4.x) is a breaking change!
It just broke my production build few weeks ago because build pipeline suddenly installed new typescript.
@emdahlstrom quick solution for you will be to lock "@nuxt/typescript-build": "2.0.2"
(no ^
version specifier!), where typescript
3.9 is used
@drakulis Thanks! That fixes the problem.
Hi,
I think I am having the same kind of problem. I am rendering it
PROJECT STRUCTURE
- project
- app
- client
- pages
- components
- .....
nuxt.config.js
tsconfig.json
vue-shim.d.ts
- dist
- client
index.html
......
- node_modules
package.json
console Error
TypeError: Cannot read property 'config' of null
at O (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:1:1329)
at exports.computed (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:15:10108)
at setup (app/client/components/main/header_component.vue?2172:44:0)
at C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@nuxtjs\composition-api\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:15:9396
at C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@nuxtjs\composition-api\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:15:8356
at me (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@nuxtjs\composition-api\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:15:7065)
at C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@nuxtjs\composition-api\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:15:8337
at a.r.data (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\@nuxtjs\composition-api\node_modules\@vue\composition-api\dist\vue-composition-api.common.prod.js:15:8842)
at C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue\dist\vue.runtime.common.prod.js:6:28667
at C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue\dist\vue.runtime.common.prod.js:6:28727
at pn (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue\dist\vue.runtime.common.prod.js:6:28934)
at a.e._init (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue\dist\vue.runtime.common.prod.js:6:32700)
at new a (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue\dist\vue.runtime.common.prod.js:6:30340)
at Vi (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue-server-renderer\build.prod.js:1:66341)
at io (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue-server-renderer\build.prod.js:1:70571)
at ro (C:\Users\quint\OneDrive\Bureaublad\cgrWebsite\node_modules\vue-server-renderer\build.prod.js:1:70244)
It says the error is coming from header_component.vue. But when i change the ssr config to false it throws no errors and renders correctly
//nuxt.config.js
export default {
target: 'static',
ssr: true, <- gives error (if false gives no error)
srcDir: '.',
env: { hostname: 'https://customgamingrig.com' },
modulesDir: ['../../node_modules'],
rootDir : ['./app/client'],
generate: {
dir: '../../dist/client',
routes() {
return axios.get('https://customgamingrig-15006.ey.r.appspot.com/posts').then(res => {
return res.data.map(post => {
return {
route: '/blog/' + post.id,
payload: post
}
})
})
}
},
Package.json
{
"name": "cgrwebsite",
"version": "1.0.0",
"description": "",
"engines": {
"node": ">=12.19.0"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@nuxt/typescript-runtime": "^2.0.0",
"@nuxtjs/composition-api": "^0.13.5",
"@nuxtjs/gtm": "^2.3.2",
"@nuxtjs/sitemap": "^2.4.0",
"@nuxtjs/strapi": "^0.1.7",
"@sendgrid/mail": "^7.3.0",
"@stripe/stripe-js": "^1.10.0",
"@types/cors": "^2.8.8",
"@types/express": "^4.17.8",
"@types/node": "^14.14.5",
"@types/stripe-v3": "^3.1.21",
"@vue/composition-api": "^1.0.0-beta.18",
"babel-plugin-transform-decorators": "^6.24.1",
"core-js": "^3.6.5",
"cors": "^2.8.5",
"es6-promise": "^4.2.8",
"express": "^4.17.1",
"npm-run-all": "^4.1.5",
"nuxt": "2.14.7",
"nuxt-typed-vuex": "^0.1.22",
"showdown": "^1.9.1",
"stripe": "^8.119.0",
"ts-node": "^9.0.0",
"ts-node-dev": "^1.0.0",
"vue-meta": "^2.4.0",
"vuex-module-decorators": "^1.0.1",
"vuex-persist": "^3.1.3"
},
"devDependencies": {
"@nuxt/types": "2.14.7",
"@nuxt/typescript-build": "^2.0.2",
"@aceforth/nuxt-optimized-images": "^1.3.0",
"@nuxtjs/tailwindcss": "^3.2.0",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-pngquant": "^9.0.1",
"imagemin-svgo": "^8.0.0",
"lqip-loader": "^2.2.1",
"node-sass": "^4.14.1",
"responsive-loader": "^2.2.0",
"sass-loader": "^10.0.4",
"sqip-loader": "^1.0.0",
"webp-loader": "^0.6.0"
},
"scripts": {
"build:client": "nuxt-ts generate ./app/client ",
"build:server": "tsc --outDir dist/functions app/server/src/intent.ts",
"build": "npm-run-all -s build:*"
},
"repository": {
"type": "git",
"url": "git+https://github.com/austinbakker/cgrWebsite.git"
},
"bugs": {
"url": "https://github.com/austinbakker/cgrWebsite/issues"
},
"homepage": "https://github.com/austinbakker/cgrWebsite#readme"
}
Sounds the main issue has been fixed
@austinbakker You can do yarn why typescript
to know if you have multiple typescript
versions installed
Have the same issue on "@nuxt/typescript-build": "^2.0.3",
Is there any plans to fix this without putting version of typescript-build on 2.02?
If you use last typescript-build
you'll have TypeScript 4, so it's your job to find in your project which package may use a lower TypeScript version (as I said : yarn why typescript
). If there is multiple TypeScript version installed, it leads to errors really difficult to debug.
You can use yarn resolutions
to force a TypeScript version.
@austinbakker I am currently experiencing the same error when running nuxt generate
on a nuxt app that pulls in a library the uses @vue/composition-api
. Did you ever manage to resolve your issue?
This is not actionable since there is no reproduction steps.
Also it has been some years since this bug report so it might not even be relevant anymore.
Please report new issue if you still experience something similar.
Hi! I'm seeing this in my Nuxt typescript projects recently. When I google the error I get lots of results from other frameworks but none from Nuxt. I might just be doing something wrong, but I've got the same error in two separate codebases.
Any ideas how to debug this further?
Looking at issues with the same message, they have been fixed by upgrading to typescript 4.0 but we're already on 4.0.3.
dependencies from package.json: