Closed mhungc closed 3 years ago
Hey!
Sorry for the late reply, I was away for a few days, but can you provide how the folder structure of your application looks like? tree -I node_modules
Are you using creact-react-app?
Did you add the script source to your index.html
?
To regenerate the runtime-env.js file, you need to stop and than restart the application.
¡Hey dont worry!
Thanks for awnser me.
Actually i'm trying to uses you example for the ts(typescript) one but i can't generate again the runtime.js inclusive i deleted from the public folder and i ran npm start again and it doesnt create the runtime-env.js...it give me the error that i copied before.
the only thing that i changed was the command for the npm start becaouse i'm on windows so to run it locally using npm i had to pot before NODE the set word like this:
"scripts": { "start": "SET NODE_ENV=development runtime-env-cra --config-name=./public/runtime-env.js && react-scripts start",
But I'm sure it's not that ...
Oh, I see, as I'm checking your attached picture again, I can see you are on windows. Sorry, sadly I did not try it on windows before releasing it, but I will today and provide some feedback :)
Yeah jeje :) many thanks!
yea Windows set NODE_ENV=development <command>
syntax doesn't seem to work, but my suggestion is just use cross-env
you'd likely want to use it anyways if you're intending on supporting multiple developers on a project, and at least it's just a devDependency. small price to pay for literally just switching one word cross-env NODE_ENV=development <command>
and it just working
I will update the docs accordingly, and after @seanblonien PR's will be merged, it will work correctly on windows too (with cross-env).
Hello team,
I follow the example but it generate me an issue:
after investigating I did this test:
"scripts": { "start": "SET NODE_ENV=development runtime-env-cra --config-name=./default/runtime-env.js"
to just generate the .js file but never generate it.
Also i play around with the example and if you delete from the ts example in the public folder the file runtime-env.js I reply the error that gives me.... so in conclusion it is not generating the .js file :(