parcel: Error: options.packageManager.resolve is not a function

πŸ› bug report

β€œOut of the blue” parcel stopped working on my local machine (Apple M1). Excactly the same configuratiion works great in Docker (x86), and on my colleagues machines (both M1).

I’m very confused to what is going on. I have tried Parcel 2.5.0 and 2.6.2, I have installed Node 16 and 18 with the excact same error.

It started happening a few weeks ago, but since I was planning to upgrade to 2.6.2, I didn’t reach out for help, but since I’m completley stuck now, hoping someone here have an idea about what could be happening!

Both parcel serve and parcel build results in the same error

πŸŽ› Configuration (.babelrc, package.json, cli command)

The command: yarn run parcel serve --cache-dir ../.parcel-cache --dist-dir ../backend/public/build2 --port 8080 --hmr-port 8082 --host 127.0.0.1 --public-url http://localhost:8080/build2


// .parcelrc
{
  "extends": "@parcel/config-default",
  "reporters": ["...","parcel-reporter-bundle-manifest"]
}

//.babelrc
{
  "plugins": [["babel-plugin-styled-components", {"ssr":  true, "pure": true }]]
}


πŸ€” Expected Behavior

Dev server starting to serve files, no errors should occur

😯 Current Behavior

cd frontend; yarn run parcel serve --cache-dir ../.parcel-cache --dist-dir ../backend/public/build2 --port 8080 --hmr-port 8082 --host 127.0.0.1 --public-url http://localhost:8080/build2
yarn run v1.22.19
$ /Users/richard/Projects/skil/eportal/frontend/node_modules/.bin/parcel serve --cache-dir ../.parcel-cache --dist-dir ../backend/public/build2 --port 8080 --hmr-port 8082 --host 127.0.0.1 --public-url http://localhost:8080/build2
Server running at http://127.0.0.1:8080
🚨 Build failed.


Error: options.packageManager.resolve is not a function

  TypeError: options.packageManager.resolve is not a function
  at loadPlugin (/Users/richard/Projects/skil/eportal/frontend/node_modules/parcel/node_modules/@parcel/core/lib/loadParcelPlugin.js:127:38)
  at async ParcelConfig.loadPlugin (/Users/richard/Projects/skil/eportal/frontend/node_modules/parcel/node_modules/@parcel/core/lib/ParcelConfig.js:117:18)
  at async Promise.all (index 1)
  at async Transformation.loadPipeline (/Users/richard/Projects/skil/eportal/frontend/node_modules/parcel/node_modules/@parcel/core/lib/Transformation.js:505:24)
  at async Transformation.run (/Users/richard/Projects/skil/eportal/frontend/node_modules/parcel/node_modules/@parcel/core/lib/Transformation.js:179:20)
  at async Child.handleRequest (/Users/richard/Projects/skil/eportal/frontend/node_modules/parcel/node_modules/@parcel/workers/lib/child.js:217:9)

πŸ’ Possible Solution

πŸ”¦ Context

This has stopped me from beeing able to work on frontend code.

πŸ’» Code Sample

🌍 Your Environment

Software Version(s)
Parcel 2.6.2 (2.5.0)
Node 16.15.1, 18.4.0
npm/Yarn Yarn v1.22.19
Operating System Mac OS 12.4

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

Omg @mischnic you are amazing! And it’s completley my fault!

It was 2 versions of @parcel/package-manager’s installed that got messed up, because my fork of parcel-reporter-bundle-manifest included the lock-file, locked to 2.4.1!

I deleted the lock-file, and upgraded parcel-reporter-bundle-manifest, then suddenly the old version of @parcel/package-manager was removed, and build worked perfect!

Thank you again for the help!!!

This is what I recreated from your instructions (which works for me): https://github.com/mischnic/parcel-issue-8290