I have done this a hundred time but i’m missing something here.
Quick demonstration repo with react-scripts.
In Demo.re Im logging values from .env using @ahrefs/bs-dotenv.
running: node ./lib/js/src/Demo.js | grep auth0
returns
AUTH0_DOMAIN: 'tenant.eu.auth0test.com',
AUTH0_CLIENTID: 'DrandomstringxHauth0test' }
domain tenant.eu.auth0test.com
clientID DrandomstringxHauth0test
From Demo.re { domain: 'tenant.eu.auth0test.com',
clientID: 'DrandomstringxHauth0test',
In app.re, logging the same data:
//app.re
...
Demo.authOptions |> Js.log2("Auth from App.re: ", _);
returns undefined for everything.
```bsh
ENV
Object { }
bundle.js:44303:1
domain undefined
bundle.js:44307:1
clientID undefined
bundle.js:44311:1
From Demo.re
{…}
clientID: undefined
domain: undefined
redirectUri: "http://localhost:3000/callback"
responseType: "token id_token"
scope: "openid"
__proto__: Object { … }
bundle.js:44321:1
Auth from App.re:
{…}
clientID: undefined
domain: undefined
redirectUri: "http://localhost:3000/callback"
responseType: "token id_token"
scope: "openid"
__proto__: Object { … }