Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple remix dev servers in one express application #9780

Open
Mordred opened this issue Jul 20, 2024 · 0 comments · May be fixed by #9931
Open

Multiple remix dev servers in one express application #9780

Mordred opened this issue Jul 20, 2024 · 0 comments · May be fixed by #9931

Comments

@Mordred
Copy link

Mordred commented Jul 20, 2024

Reproduction

https://github.com/Mordred/multi-remix

npm install
node server.js

Open https://localhost:3000/admin/ and https://localhost:3000/blog/

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 88.30 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
    Watchman: 2024.05.06.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 126.0.6478.183
    Edge: 126.0.2592.113
    Safari: 17.5
  npmPackages:
    @remix-run/express: 2.10.3 => 2.10.3
    vite: 5.3.4 => 5.3.4

Used Package Manager

npm

Expected Behavior

Both routes should be working correctly

Actual Behavior

One route is throwing error, because server-runtime is using globally set dev server hook, so it is impossible to have two (or more) remix apps in one project.

https://github.com/remix-run/remix/blob/main/packages/remix-server-runtime/dev.ts#L41
https://github.com/remix-run/remix/blob/main/packages/remix-dev/vite/plugin.ts#L1317

Second dev server is rewriting hook for the first one which will then crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants