a teammate's pr broke parcel: cannot find module after a fresh clone. where do i start??

Solvedbuildjavascriptnpm6 replies · 98 views · started
Accepted solution by Cleo M. — Can't resolve 'fs' means code meant for Node ended up in the browser bundle 👍 Webpack 5 and Vite dont polyfill Node core modules 👍 Find…
  1. guys pls help merged a dependency update PR and now Parcel refuess to build:

    $ npm install

    $ npm install
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: my-dashboard@0.1.0
    npm ERR! Found: react@19.x
    npm ERR! node_modules/react
    npm ERR!   react@"^19" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"^17 || ^18" from some-chart-lib@x
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force or --legacy-peer-deps
    

    the error is Cannot find module after a fresh clone... the PR looked harmless, a few version bumps. I'd rather understand teh cause than blindly revert or slap a flag on it... what's teh right way to read this error and fix it properly? happy to share more of the log if someone tells me which lines matter. seriously need help here 😭

    2
  2. Is the lockfile committed, and does CI use npm ci? ?

    thinking

    1 2 helpful
  3. the lines above show the conflict comes from a plugin that hasnt updated its peer dependency range yet. idk what else to say tbh

    33 0 helpful
  4. everyone keeps saying this but nobody posts proof... lol this thread is gold

    2 0 helpful
  5. oof for JavaScript heap out of memory, raise the limit for the build: NODE_OPTIONS=--max-old-space-size=4096 npm run build. If it keeps growing, look for huge source maps, giant JSON imports or an accidental import of a whole library. hope that helps :)

    0 2 helpful
  6. Accepted solution

    Can't resolve 'fs' means code meant for Node ended up in the browser bundle 👍 Webpack 5 and Vite dont polyfill Node core modules 👍 Find which import pulls it in (often a server-only helper imported from a shaerd file) and keep it on the server side.

    0 4 helpful
  7. @stack_rider WOWWW pinned Node in .nvmrc and CI, committed the lockfile, switched to npm ci. Parcel builds everywhere again... thx!

    2 0 helpful

Reply to this topic

Sign in or create an account to reply.