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 { β¦ }