Closed n-hebert closed 2 months ago
@n-hebert just tried it on my end and the version is coming up blank — I think maybe you put that value into your env by hand?
I did some googling and it seems like we also need to update the package.json commands to inject the version into the environment, this worked for me:
"start": "REACT_APP_VERSION=$npm_package_version react-scripts start",
"build": "REACT_APP_VERSION=$npm_package_version react-scripts build",
@n-hebert just tried it on my end and the version is coming up blank — I think maybe you put that value into your env by hand?
I did some googling and it seems like we also need to update the package.json commands to inject the version into the environment, this worked for me:
"start": "REACT_APP_VERSION=$npm_package_version react-scripts start", "build": "REACT_APP_VERSION=$npm_package_version react-scripts build",
Ah woops! On it!
Hmm, were you on the latest version? I can confirm there was not an accidental manual insertion, and it wouldn't need the injection as you show since the .env
file gets picked up automatically.
At least on my side, there's no REACTAPP anything in my shell env and it picks up from the .env
file. Might need to pair if you can't fetch and find the same!
Oooh, I missed the .env change. Hmm, I'm hoping to have this pull from package.json so the version is only in one place / easier to maintain
Oooh, I missed the .env change. Hmm, I'm hoping to have this pull from package.json so the version is only in one place / easier to maintain
~I agree a hundred percent. I see it as a next ticket to do; merge this one, and then open an issue to de-duplicate. Rationale: this one patches a user-visible change (hi-pri) the other is just tech debt (low-pri).~
~Do you know if there's a low-hanging fruit for this one? I think that they are such diverse interests that it's not possible to have one read from the other right now.~ ~Leveraging a build script to .env.local could be a bit flaky, but work, if the duplication isn't worth merging.~
How about this commit, @toddmedema ? :smile:
Closes #81