I have developed one react app from scratch by creating using create-react-app
, and it is working well on my local env. But after deploying to production, I am getting Cannot find module 'url'
error when trying to see all pages on the browser.
So I added 'url' to package.json, but still getting the same error.
Asked
Active
Viewed 26 times
0

Ping Zhao
- 266
- 5
- 19
1 Answers
0
I don't think this is the best solution for this issue, but I think my solution will be helpful. My issue was coming from URLSearchParams
class in my codebase.
I have used useParams
instead of using it and removed it from my codebase, and then my deploying to production was done successfully.

Ping Zhao
- 266
- 5
- 19