I'm trying to utilise an API token that's currently residing in my .env file. I've tried
require('dotenv').config()
console.log(process.env)
and am returned with this error
Uncaught ReferenceError: require is not defined
so I tried.
import * as dotenv from 'dotenv'
dotenv.config()
and get this error in return
Uncaught ReferenceError: require is not defined
I am using react and have used the require method in another js file on the same project and it works perfectly fine, but trying to use them in this jsx file doesn't seem to work I can't understand why,
Thank you.