You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My public/index.html seems to have access to PUBLIC_URL but not to any other environment variable.
$ cat .env
REACT_APP_ASSETS_URL=abc
still when referring the var REACT_APP_ASSETS_URL is not resolved in public/index.html:
npm start results in URIError: Failed to decode param '/%REACT_APP_ASSETS_URL%/main.min.js' and the html still has the var string unresolved whereas the js code can access the var with <strong>{process.env.REACT_APP_ASSETS_URL}</strong>
I think not only the PUBLIC_URL var should be accessible in the html, but all vars.
Background:
My react app is included in a page that already has some header and footer which comes with external js and css. I copied the header and footer html to the public/index.html, but like to retrieve the legacy css and js from an external server.
The text was updated successfully, but these errors were encountered:
My
public/index.html
seems to have access toPUBLIC_URL
but not to any other environment variable.still when referring the var
REACT_APP_ASSETS_URL
is not resolved inpublic/index.html
:npm start
results inURIError: Failed to decode param '/%REACT_APP_ASSETS_URL%/main.min.js'
and the html still has the var string unresolved whereas the js code can access the var with<strong>{process.env.REACT_APP_ASSETS_URL}</strong>
I think not only the
PUBLIC_URL
var should be accessible in the html, but all vars.Background:
My react app is included in a page that already has some header and footer which comes with external js and css. I copied the header and footer html to the public/index.html, but like to retrieve the legacy css and js from an external server.
The text was updated successfully, but these errors were encountered: