-2

how can i use .env variable in Codesandbox ? For now i've this error when using a .env file with process.env : 'process' is not defined - eslint

I've try to declare process to true in a .eslintrc file : https://eslint.org/docs/user-guide/configuring

This is my code : https://codesandbox.io/s/vue-env-qi70n

David
  • 75
  • 1
  • 1
  • 5
  • Hi, and welcome to StackOverflow! In order for us to help you, it is usually helpful to include what you have previously attempted, as well as as a detailed explanation of the issue you are attempting to solve. I would recommend reading [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask), which offers several tips to this end. – CmdrSharp Apr 04 '20 at 21:33

1 Answers1

0

In order to use environment variables you need to be using a container sandbox, so it has an actual server. Try using a template like Node and using Vue with it.

There's more info on using secrets on CodeSandbox in our docs https://codesandbox.io/docs/secrets, as well as the difference between container and client sandboxes (https://codesandbox.io/docs/environment)

Gareth
  • 117
  • 4