remix-run / grunge-stack

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
439 stars 95 forks source link

Fresh deployment leads to Internal Server Error #168

Closed TheRobotCarlson closed 1 year ago

TheRobotCarlson commented 1 year ago

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

Following the readme step for step:

  1. npx create-remix@latest --template remix-run/grunge-stack
  2. Validate everything works locally: npm run validate npm run dev
  3. Create a new github repo
  4. Add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to your GitHub repo's secrets. Go to your AWS security credentials and click on the "Access keys" tab, and then click "Create New Access Key", then you can copy those and add them to your repo's secrets.
  5. Create the session and arc app secret:
    npx arc env --add --env staging ARC_APP_SECRET $(openssl rand -hex 32)
    npx arc env --add --env staging SESSION_SECRET $(openssl rand -hex 32)
    npx arc env --add --env production ARC_APP_SECRET $(openssl rand -hex 32)
    npx arc env --add --env production SESSION_SECRET $(openssl rand -hex 32)
  6. Confirm these get put in Parameter store
  7. init repo and push to github
  8. Wait for deploy to finish, check production url
    {"message":"Internal Server Error"}
  9. Check cloudwatch logs:
    2023-09-23T20:08:57.792Z    da801d89-8960-42c2-b45e-c3f84c59da2a    ERROR   Invoke Error    {
    "errorType": "ReferenceError",
    "errorMessage": "Request is not defined",
    "stack": [
        "ReferenceError: Request is not defined",
        "    at createRemixRequest (/var/task/node_modules/@remix-run/architect/dist/server.js:53:3)",
        "    at Runtime.handler (/var/task/node_modules/@remix-run/architect/dist/server.js:37:19)",
        "    at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1147:29)"
    ]
    }

Expected Behavior

Application should be deployed and display output at the endpoint from the production deploy.

Actual Behavior

Error at the production url:

{"message":"Internal Server Error"}

Error in cloudwatch logs:

2023-09-23T20:08:57.792Z    da801d89-8960-42c2-b45e-c3f84c59da2a    ERROR   Invoke Error    {
    "errorType": "ReferenceError",
    "errorMessage": "Request is not defined",
    "stack": [
        "ReferenceError: Request is not defined",
        "    at createRemixRequest (/var/task/node_modules/@remix-run/architect/dist/server.js:53:3)",
        "    at Runtime.handler (/var/task/node_modules/@remix-run/architect/dist/server.js:37:19)",
        "    at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1147:29)"
    ]
}
TheRobotCarlson commented 1 year ago

This will be solved once https://github.com/remix-run/grunge-stack/pull/167 is merged.