question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting server in remix.config.js fails when using express adapter

See original GitHub issue

What version of Remix are you using?

1.4.3

Steps to Reproduce

  1. Create app using create-remix (express, just the basics, typescript)
  2. Set server in remix.config.js to let remix produce one consolidated build.
  3. npm run build works
  4. npm run dev fails

Sample code here: https://github.com/edwin177/remix-express/tree/express-server-build

Expected Behavior

Server should load

Actual Behavior

App crashes with the following error:

/home/xxx/remix-express/node_modules/@remix-run/server-runtime/routes.js:18
  return Object.entries(manifest).filter(([, route]) => route.parentId === parentId).map(([id, route]) => ({ ...route,
                ^
TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at Object.createRoutes (/home/xxx/remix-express/node_modules/@remix-run/server-runtime/routes.js:18:17)
    at Object.createRequestHandler (/home/xxx/remix-express/node_modules/@remix-run/server-runtime/server.js:26:25)
    at createRequestHandler (/home/xxx/remix-express/node_modules/@remix-run/express/server.js:35:28)
    at Object.<anonymous> (/home/xxx/remix-express/build/index.js:42:5)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:6
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
keoy7amcommented, Oct 30, 2022

This issue is still happening. (try upgrading from 1.2.3 to 1.7.4 Today)

3reactions
edwin177commented, Sep 10, 2022

Btw, still getting the same error with 1.7.0.

Sample code: https://github.com/edwin177/remix-express-1.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

remix-run/serve
config.js is not guaranteed to be available in production, so you need to tell Remix where your server build is with this option....
Read more >
Super Simple Start to Remix - Kent C. Dodds
Cool, with those things installed, let's configure Remix. ... There are @remix-run/{adapter} packages that we can use for server-side ...
Read more >
Can't access new Remix app - Questions / Help - Fly.io
It is a remix app with express. ... "postinstall": "remix setup node", "start": "remix-serve build", "dev": "pm2-dev . ... server/dist .
Read more >
remix-utils - npm
Start using remix-utils in your project by running `npm i ... If you want to setup it globally once, you can do it...
Read more >
Remix: middleware pattern to run code before loader on every ...
You can also run arbitrary code before handing the request to remix in the JS file where you use the adapter for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found