remix-run / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
29.24k stars 2.46k forks source link

Remix 1.12.0 Unable to load app: `Cannot read properties of undefined (reading 'v2_errorBoundary')` #5368

Closed karissekjw closed 1 year ago

karissekjw commented 1 year ago

What version of Remix are you using?

1.12.0

Are all your remix dependencies & dev-dependencies using the same version?

Steps to Reproduce

Context

What I did

  1. Updated package.json to remix v1.12.0
    "dependencies": {
    "@remix-run/express": "^1.12.0",
    "@remix-run/node": "^1.12.0",
    "@remix-run/react": "^1.12.0",
    "@remix-run/server-runtime": "^1.12.0",
    }
  2. Ran npm install
  3. Ran npm run build
  4. Ran npm run dev
  5. Go to http://localhost:3000/ and the below error shows up.
    TypeError: Cannot read properties of undefined (reading 'v2_errorBoundary')
    at /<file_dir>/build/server.js:38612:39
    at Array.map (<anonymous>)
    at Object.createStaticHandlerDataRoutes (/<file_dir>/build/server.js:38611:85)
    at Object.createRequestHandler2 (/<file_dir>build/server.js:38698:31)
    at createRequestHandler2 (/<file_dir>/build/server.js:39888:32)
    at /<file_dir>/build/server.js:43034:69
    at Layer.handle [as handle_request] (/<file_dir>/build/server.js:17891:9)
    at next (/<file_dir>/build/server.js:18060:17)
    at next (/<file_dir>build/server.js:18056:11)
    at next (/<file_dir>/build/server.js:18056:11)

    It seems like function createStaticHandlerDataRoutes(manifest, future, parentId) {} method in @remix/server-runtime/dist/routes.js is receiving nil for future which caused the issue that I'm experiencing.

Expected Behavior

I've tried to create blue stacks project from a clean slate and createStaticHandlerDataRoutes seems to receive the following future value which allows the app to load correctly:

{
  unstable_cssModules: false,
  unstable_cssSideEffectImports: false,
  unstable_dev: false,
  unstable_vanillaExtract: false,
  v2_errorBoundary: false,
  v2_meta: false,
  v2_routeConvention: false
}

Actual Behavior

The error should not occur and the app should be able to run as per normal.

machour commented 1 year ago

@karissekjw usually this is caused by one of the remix deps still being on a prior version. Are you devDependencies also up to date?

If that's the case, try npm list |grep remix to see if another non listed @remix-run dependency is outdated

machour commented 1 year ago

Also, I would advise, although not mandatory, to do an incremental update for remix, starting with 1.8.0.

This would allow you to go through all the changelogs (starting here) and update your application to leverage the new features.

Of course, no need to bump through the bug fixing releases, so basically your upgrade path would be:

karissekjw commented 1 year ago

Hey @machour thanks for the swift response. You're right, seems like I've missed out @remix-run/dev. Updated it accordingly and it works now. Thanks, appreciate the advice you've mentioned above 🙏 .

Closing this issue since it's not a bug.