Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I got error ReferenceError: process is not defined #5

Closed
iWyse opened this issue Sep 9, 2022 · 2 comments
Closed

I got error ReferenceError: process is not defined #5

iWyse opened this issue Sep 9, 2022 · 2 comments

Comments

@iWyse
Copy link

iWyse commented Sep 9, 2022

i copy your code and got error ReferenceError: process is not defined.

Why ?

index.js
import _ from 'lodash'

function component() {
const elem = document.createElement('div')

elem.innerHTML = _.join(['Hello', process.env.NAME], ' ')

return elem
}

document.body.appendChild(component())

.env
NAME= CHANGE_ME

@meisammofidi
Copy link

Same as me :-(

@AleksRap
Copy link

AleksRap commented Jan 29, 2023

Hi. You need to add a path to your file if the file is different from the default

Example:
If your env file has name .env.production - you need to add in plugins next config:
new Dotenv({ path: 'path to your file/.env.production' })

@motdotla motdotla closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants