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

[remix] Cannot find module 'remix-router-dom' #5860

Closed
3 tasks done
joelazar opened this issue Sep 30, 2022 · 0 comments · Fixed by #5897
Closed
3 tasks done

[remix] Cannot find module 'remix-router-dom' #5860

joelazar opened this issue Sep 30, 2022 · 0 comments · Fixed by #5897
Assignees
Labels
Package: remix Issues related to the Sentry Remix SDK Type: Bug

Comments

@joelazar
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/remix

SDK Version

7.14.0

Framework Version

Remix 1.7.2

Link to Sentry event

No response

Steps to Reproduce

In a monorepo setup, loading the react-router-dom is not working when the node server is built for production. I've made a small example repo for reproducing the bug.
Also, I've added a README.md for describing the reproducing steps.

As far as I can see, this might be caused by PR 5810.

Expected Result

The server should serve the incoming request without any error.

Actual Result

❯ yarn dev
[0] npm WARN ignoring workspace config at /home/joelazar/git/joelazar/sentry-indie-stack/myapp/.npmrc 
[0] 
[0] > generate:css
[0] > tailwindcss -o ./app/styles/tailwind.css --watch
[0] 
[1] Express server listening on port 3000
[0] 
[0] Rebuilding...
[0] Done in 192ms.
[1] Error: Cannot find module '/home/joelazar/git/joelazar/sentry-indie-stack/myapp/node_modules/react-router-dom'
[1] Require stack:
[1] - /home/joelazar/git/joelazar/sentry-indie-stack/myapp/build/server.js
[1]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[1]     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[1]     at Module.require (node:internal/modules/cjs/loader:1005:19)
[1]     at require (node:internal/modules/cjs/helpers:102:18)
[1]     at /home/joelazar/git/joelazar/sentry-indie-stack/myapp/build/server.js:30185:52
[1]     at /home/joelazar/git/joelazar/sentry-indie-stack/myapp/build/server.js:30185:17
[1] yarn dev:remix exited with code 1
--> Sending SIGTERM to other processes..
[0] yarn dev:css exited with code 1
@onurtemizkan onurtemizkan added Status: Confirmed Package: remix Issues related to the Sentry Remix SDK and removed Status: Untriaged labels Sep 30, 2022
AbhiPrasad pushed a commit that referenced this issue Feb 21, 2024
Fixes: #10349
Related: #5860
Related: #10458

Removes dynamic loading of `react-router-dom` and makes
`@remix-run/router` a peer dependency.

We don't need to dynamically load `react-router-dom` as our TypeScript
version is now up-to-date.
onurtemizkan added a commit that referenced this issue Feb 21, 2024
Fixes: #10349
Related: #5860
Related: #10458

Removes dynamic loading of `react-router-dom` and makes
`@remix-run/router` a peer dependency.

We don't need to dynamically load `react-router-dom` as our TypeScript
version is now up-to-date.
AbhiPrasad pushed a commit that referenced this issue Feb 21, 2024
Backports #10479 to v7 branch

Original PR Description:
> Fixes: #10349
> Related: #5860
> Related: #10458
> 
> Removes dynamic loading of `react-router-dom` and makes
`@remix-run/router` a peer dependency.
> 
> We don't need to dynamically load `react-router-dom` as our TypeScript
version is now up-to-date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: remix Issues related to the Sentry Remix SDK Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants