N
NuxtDANANZ M1

Missing NODE_ENV in nuxt

does nuxt has an alternative to config.NODE_ENV === 'development'? I mean, how can I tell if Im in local devlopment server or production build?
UU
Unknown Userβ€’40d ago
M
manniLβ€’40d ago
yes, there is πŸ˜„ in the config you can use $production and $development (top-level) to set different values Even recorded a video about that releasing tomorrow πŸ˜„
DM
DANANZ M1β€’39d ago
That's weird.. when trying to access config.NODE_ENV it's undefined. Does process.env.NODE_ENV will work instead?
M
manniLβ€’39d ago
@DANANZ M1 config.NODE_ENV is not a thing
M
manniLβ€’39d ago
Alexander Lichter
YouTube
😲 An environment-aware Nuxt Configuration
🎬Finally your app is in production - amazing! But how can we ensure that certain configurations or even whole modules are only loaded in dev, or only in production? Would it be even possible to change the nuxt configuration for test environments? A common way is using process.env.NODE_ENV - but luckily, Nuxt provides a more descriptive and foolp...
DM
DANANZ M1β€’39d ago
You actually just posted a video about it πŸ˜… Keep on with the great content! Love it πŸ’― Got my answer thanks!
M
manniLβ€’39d ago
I told you I will πŸ˜„ Glad to hear you enjoy my content πŸ™
Got my answer thanks!
Awesome! πŸ™Œ
UU
Unknown Userβ€’29d ago
F
Floβ€’29d ago
That's on purpose... I've had the github issue related to that recently. Gist is: It will always be production when running a production build.
M
manniLβ€’28d ago
yes and no. I also mentioned that in
M
manniLβ€’28d ago
GitHub
Load nuxt config with different envName for env-specific configs ...
Hey all πŸ‘‹ c12 provides us with the amazing opportunity to add env-specific configs to the nuxt config (also covered in my video), therefore relying on NODE_ENV by default. While it is technically p...
Want results from more Discord servers?
Add your server
More Posts
Can i set tailwind configs when extending layers?I'm using nuxt-tailwind module with a default theme, can i have different configs when extending thi`?raw` import works in vite (`nuxt dev`) but not in rollup (`nuxt generate`)As described in the title `?raw` works in vite but not in rollup. Simple steps to reproduce: `npx nSPA w/ SEO or SSG + nitro?i'm creating a SPA and i've opted to use nuxt because of the ease of development (especially for theStrange error when i start my applicationWhen i launch nuxt, i have an 503 error and i cant acces to localhost:3000. I have tried to clear brError with i18n and sitemapI get this error : "Plugin nuxt-site-config:i18n depends on i18n:plugin but they are not registereCheck inside plugin if running in dev modeI have created a plugin that sends nuxt/vue errors using some hooks to Sentry. I do however not wantIs anyone using application insights with Nuxt 3?Does anyone have applications insights working with Nuxt to track and log on the client and server? Nuxt theming options.I want to develop a Nuxt theming project similar to WordPress theming options. There will be 3 or 4 MicroFrontend vs Layer?Hello, I wonder what is the difference between MicroFrontends and the Layers in Nuxt? Does anyone knsearch page dont workit only shows the result of the first search, to show the results of other searches, the user has toserver middleware added to nuxt configHi all The docs say "Nuxt will automatically read in any file in the ~/server/middleware to create sError 500: A composable that requires access to the Nuxt instanceI have this error in my composable that I absolutely don't cromprend given that most of the code is Nuxt UI IconsCan please someone explain to me how to use Nuxt UI Icons ??? The documentation says : `Use the namawait useAsyncData in setup doesn't block navigationI want to wait until navigating to the next page until the store data has been fetched and set. I'm Intercepting RoutesHey dear NuxtCommunity! although I have experiences in React, Iβ€˜m pretty new to vue/nuxt. For a prHow too hook into a server response using Nuxt 3?I need to hook in the response of `/_ipx`. If the image is corrupted `/_ipx` will throw an error, beHydratation issue using pinia store (stackblitz reproduction)I'm having an issue with SSR rendering using pinia store. Here the issue : https://stackblitz.com/eShared types between server and vueWhere can I store zod schemas and types that will be used by both the backend and vue? (so that the Fetch method Not Allowed, but works in other clientsI need to do a GET to have a list, I need the authoritation with cookie. When I use Rest Client or THow to disable the nuxt-loading-enable-animation local storage ?my nuxt app sets this value in local storage: nuxt-loading-enable-animation = true How can I disabl