Open test-2287 opened 2 years ago
Did you run the fly secrets set
command before deploying?
@kentcdodds yes~ , i ran fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app blog-tutorial-c08c
showed in the README and ran fly secrets set ADMIN_EMAIL=rachel@remix.run
show in the course.
Yeah, that's quite strange... I'm sorry, I don't know what it could be 😬
Yeah, that's quite strange... I'm sorry, I don't know what it could be 😬
i found cypress ran start:mocks failed cause it can't get the env variables, since the default NODE_ENV of remix serve run is production
, it will always throw Error in tiny-invariant.js
var isProduction = process.env.NODE_ENV === 'production';
var prefix = 'Invariant failed';
function invariant(condition, message) {
if (condition) {
return;
}
if (isProduction) {
throw new Error(prefix);
}
var provided = typeof message === 'function' ? message() : message;
var value = provided ? prefix + ": " + provided : prefix;
throw new Error(value);
}
module.exports = invariant;
i added the env as below in deploy.yml file and it works, i not sure if there is another better solution.
Oh, did you update the .env.example
? That's important because the github action will copy that file to .env
before running the E2E tests.
Oh, did you update the
.env.example
? That's important because the github action will copy that file to.env
before running the E2E tests.
I am getting the same error. I tried updating the .env.example and it still crashes. I'll file a separate issue
For anyone else trying to test the build locally, remix does not use .env
file by default (link), also see this issue.
The solution is to use e.g. dotenv-cli
like this: "start": "dotenv -e .env.production remix-serve build"
Hi, i followed the egghead course and the README file to deploy, but got
throw new Error(prefix);
attiny-invariant
and i found
npm run start:mocks
have the same issue in my local dev env.node version: v16.16.0 npm version: 8.11.0 platform: macOS bigSur