Open keyiis opened 10 months ago
I discovered the cause of the error, When vue compile node_modules/graphql/jsutils/instanceOf.mjs
,the globalThis.process.env.NODE_ENV
will be converted to globalThis."development"
.
I discovered the cause of the error, When vue compile
node_modules/graphql/jsutils/instanceOf.mjs
,theglobalThis.process.env.NODE_ENV
will be converted toglobalThis."development"
.
I also ran into this problem and it is currently being discussed in a thread on the graphql-js repository. You can find the ongoing discussion here: graphql/graphql-js#3978.
There I found a workaround that worked for me. By changing the check from:
globalThis.process && globalThis.process.env.NODE_ENV === 'production'
to
globalThis.process && globalThis.process.env['NODE_ENV'] === 'production'
I was able to resolve the problem in my project. Although this is just a temporary solution until a more permanent fix is implemented in the library.
Describe the bug I add Apollo client in main.ts, like this:
Then I run my vue project. The following error occurs
Versions vue:3.2.25 vue-apollo: I don't konw @apollo/client:3.8.7
My package.json { "name": "client", "private": true, "version": "0.0.0", "scripts": { "dev": "vite --config vite.config.ts", "build": "vue-tsc --noEmit && vite --config vite.config.ts build", "preview": "vite preview" }, "dependencies": { "@apollo/client": "^3.8.7", "@element-plus/icons-vue": "^2.0.10", "@neysf/qiyu-web-sdk": "^1.1.1", "@vant/touch-emulator": "^1.4.0", "@vue/apollo-composable": "^4.0.0-beta.11", "@vue/apollo-option": "^4.0.0-beta.9", "axios": "^0.27.2", "dayjs": "^1.11.7", "element-plus": "^2.2.32", "graphql": "^16.8.1", "graphql-tag": "^2.12.6", "string-similarity-js": "^2.1.4", "ts-md5": "^1.3.1", "vant": "^4.0.10", "vue": "^3.2.25", "vue-router": "^4.0.15", "vuex": "^4.0.2" }, "devDependencies": { "@vitejs/plugin-vue": "^2.3.3", "sass": "^1.52.1", "sass-loader": "^13.0.0", "typescript": "^4.5.4", "vite": "^2.9.9", "vue-tsc": "^0.34.7" } }