Closed idc77 closed 1 year ago
Hi @idc77! π
It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.
Without a proper reproduction, your issue will have to get closed.
Thank you for your collaboration. π
How do I upgrade to Vite v4?
See #14077
I am having the same issue. I can't seem to get rid of it.
What was the solution?
same error from here :(
See my solution here: https://github.com/graphql/graphql-js/issues/3919#issuecomment-1633673123
Here is my solution:
Set define
configuration in quasar.config.js
> build
> extendViteConf
:
build: {
extendViteConf(viteConf) {
viteConf.define = {
'globalThis.process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV
),
};
},
}
extendViteConf(viteConf) { viteConf.define = { 'globalThis.process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV ), }; },
Thanks, this worked well for me
Here is my solution:
Set
define
configuration inquasar.config.js
>build
>extendViteConf
:build: { extendViteConf(viteConf) { viteConf.define = { 'globalThis.process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV ), }; }, }
- define : Define global constant replacements. Entries will be defined as globals during dev and statically replaced during build.
can confirm this works, has solved my issue as well!
Here is my solution:
Set
define
configuration inquasar.config.js
>build
>extendViteConf
:build: { extendViteConf(viteConf) { viteConf.define = { 'globalThis.process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV ), }; }, }
- define : Define global constant replacements. Entries will be defined as globals during dev and statically replaced during build.
Not a solution for me! Pervents values from .env to be accessible via process.env.xxx
@WulfP use quasar.config file > build.rawDefine
:
build: {
rawDefine: {
'globalThis.process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}
}
Here is my solution:
Set
define
configuration inquasar.config.js
>build
>extendViteConf
:build: { extendViteConf(viteConf) { viteConf.define = { 'globalThis.process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV ), }; }, }
- define : Define global constant replacements. Entries will be defined as globals during dev and statically replaced during build.
thanks! it work
thank you.
rawdefine worked (because I have stuff in .env)
Let's hope this has no long-term implications.
thank you.
rawdefine worked (because I have stuff in .env)
Let's hope this has no long-term implications.
Here is my solution, it can keep old env
extendViteConf(viteConf) {
viteConf.define['globalThis.process.env.NODE_ENV'] =
viteConf.define['process.env.NODE_ENV'];
return viteConf;
},
this one solved mine
export default defineConfig({
define: {
'globalThis.process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
},
});
What happened?
Please see https://github.com/graphql/graphql-js/issues/3919
What did you expect to happen?
No error
Reproduction URL
N/A
How to reproduce?
not sure have graphql package >16.6.0 installed I guess, from what I gather in the Nuxt issue when I downgraded to 16.6.0 the error went away. I don't know how to force quasar to use Vite v4.
How do I upgrade to Vite v4?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)
Platforms/Browsers
No response
Quasar info output
Relevant log output
Additional context
using quasar with apollo graphql client