0

I tried using require('dotenv').config() in my javascript file and my package.json, I have dotenv as my dependency, I am able to check my environment variable however, when it comes to loading my javascript page, it throws an error: "Uncaught ReferenceError: require is not defined". If I remove require('dotenv').config() my page loads perfectly with javascript however, when I add require('dotenv').config() this again, it throws the subject line error. Can someone please help me with the solution, thanks in advance.

0 Answers0