Can't deploy to Netlify when using @Nuxt/dotenv

stuartjnelson
0
stuartjnelson
commented 9 months ago

Hello!

I've been unable to deploy to Netlify when using the plugin.

  • "@nuxtjs/dotenv": "^1.1.0"
  • "nuxt": "^1.0.0"
modules: [
        ['@nuxtjs/dotenv']
]

Netlfiy Error log when using the module
Netfliy log for successful deployment

I've tried a whole bunch of different configurations inside nuxt.config.js but could'nt get anything to work. I don't get the issue when I generate the static site locally just when using Netlify. I have spoke to their support and they can't see the issue. I am wondering if its to do with the NPM WARN about missing optional dependencies? Let me know if you need anymore info!

0
VitorLuizC
10
VitorLuizC
commented 9 months ago

Its because @nuxtjs/dotenv can't use system's variables when .env file is not found #12.

You can deploy .env file too. It's a bad practice, but works.

0
stuartjnelson
0
stuartjnelson
commented 9 months ago

Thanks @VitorLuizC. I'll close for now then if that ticket is dealing with it. I think I've got a way round it as I just needed the .env for a Google analytics and I got a sneaky fix from this issue ticket for that use case

0
JulienTant
245
JulienTant
commented 9 months ago

Hi, i've just published v1.1.1, now .env file is not mandatory !

0
lmrarturo
0
lmrarturo
commented 16 days ago

Hi guys,

How are you implementing the variables without .env with Netlify? for me is not working.

Help!

Thank you!

0
Informations
Question โ€ข Resolved
#c7 - Created 9 months ago