create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Module not found: Error: Can't resolve 'path'

Open SunilPrasad opened this issue 2 years ago • 3 comments

I have upgraded an application from react 17 to react 18 and now using "react-scripts 5.0.1" . Now npm build throwing error

image

I would like to know how to include polyfill when using create-react-app .

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Webpack configuration

Environment

Node 14.16.1

Expected behavior

Should build without any error.

Actual behavior

npm run build throwing error "Module not found: Error: Can't resolve 'path'".

SunilPrasad avatar Sep 06 '22 09:09 SunilPrasad

Looks similar to this issue: https://github.com/facebook/create-react-app/issues/11756

mofojed avatar Sep 06 '22 19:09 mofojed

@SunilPrasad please do let me know, if your issue is resolved ? if yes update your comments here.

Saketh-Reddy avatar Sep 07 '22 14:09 Saketh-Reddy

@Saketh-Reddy Why would the issue be resolved? As noted on #11756 , this is a frustrating issue that requires hacks to workaround. A few of the recent comments sum it up: https://github.com/facebook/create-react-app/issues/11756#issuecomment-1218757584

Without a recommended path for resolving this issue, many people will not upgrade to CRA5.

mofojed avatar Sep 07 '22 14:09 mofojed