Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
dotenv Error: Cannot find module at {Path}/main.jsx

I'm building a web-site, and using Firebase to store data. So, the private keys are on a .env file. I'm trying to import them in a firebase config file. I'm using import in order to use modules. And by following the guide in the dotenv doc, I ran 'node -r dotenv/config main.jsx' on my terminal. But I got an error, and I don't understand what to do. Thanks !

Folders' Architecture enter image description here

Firebase.js enter image description here

main.jsx enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It seems you are using Vite which already supports .env files.

It's exposed in the import.meta.env object. Try replacing process.env. for import.meta.env. in your code.

See the documentation here: https://vitejs.dev/guide/env-and-mode.html#env-files

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!