rasengan-dev / rasenganjs

React Framework which helps you to create modern and performant web applications easily.
MIT License
63 stars 2 forks source link

issue accessing environment variables #6

Closed ASSAF1er closed 5 months ago

ASSAF1er commented 5 months ago

I have a .env file at the root of my project with an env variable RASENGAN_MY_VARIABLE and I want to access it in a component.

I actually have import.meta.env.RASENGAN_MY_VARIABLE; in the component

But when I try console.log(RASENGAN_MY_VARIABLE) it returns an error saying the variable is not defined

github-actions[bot] commented 5 months ago

Thanks for your interest by sharing what's going wrong with Rasengan.js, your contribution will help more than one.

dilane3 commented 5 months ago

I have a .env file at the root of my project with an env variable RASENGAN_MY_VARIABLE and I want to access it in a component.

I actually have import.meta.env.RASENGAN_MY_VARIABLE; in the component

But when I try console.log(RASENGAN_MY_VARIABLE) it returns an error saying the variable is not defined

Hello @ASSAF1er

Please can you provide a simple screenshot of your .env file and the file where you are importing your environment variable ?

I want to know exactly how the problem occures.