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

Uncaught Error: Cannot find module in example

Open ats1999 opened this issue 4 years ago • 2 comments
trafficstars

I started root project by npm start

Result

Watching source, compiling to dist:
Wrote 503 kB: index.modern.js.gz
       363 kB: index.modern.js.br
Wrote 504 kB: index.js.gz
       363 kB: index.js.br

I started example by cd example && npm start

PS C:\Users\Rahul kumar\Desktop\Projects\util-pkg-s\test\ev\example> npm start 

> @bdevg/[email protected] start C:\Users\Rahul kumar\Desktop\Projects\util-pkg-s\test\ev\example> node ../node_modules/react-scripts/bin/react-scripts.js start

i 「wds」: Project is running at http://192.168.43Failed to compile.
Failed to compile.

./src/index.css
Cannot find file: 'addStyles.js' does not match 
the corresponding name on disk: 'C:\Users\Rahul 
kumar\Desktop\Projects\util-pkg-s\test\ev\node_modules\style-loader\lib\desktop'

Error on browser console

index.js:7 Uncaught Error: Cannot find module 'C:\Users\Rahul kumar\Desktop\Projects\util-pkg-s\test\ev\node_modules\webpack\hot\dev-server.js'
    at webpackMissingModule (index.js:7)
    at Object.1 (index.js:7)
    at __webpack_require__ (bootstrap:784)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1

ats1999 avatar Mar 28 '21 04:03 ats1999

I faced the same issue when I removed my node_modules folder and reinstalled everything. Solution was to rebuild the link across the 2 folders. root folder: sudo npm link a path will return example folder: sudo npm link path/that/returned/in/the/previous/step

npm start both and should work.

vitorpdasilva avatar Apr 01 '21 03:04 vitorpdasilva

same issue, any solution??

durgesh2007 avatar May 05 '22 12:05 durgesh2007