Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel tries to install package on missing local plugin #9240

Closed
wenkokke opened this issue Sep 12, 2023 · 0 comments 路 Fixed by #9242
Closed

Parcel tries to install package on missing local plugin #9240

wenkokke opened this issue Sep 12, 2023 · 0 comments 路 Fixed by #9242

Comments

@wenkokke
Copy link

wenkokke commented Sep 12, 2023

馃悰 bug report

When .parcelrc references a non-existant local plugin, Parcel attempts to install a package, then fails with a confusing error message.

馃帥 Configuration (.parcelrc, package.json, cli command)

// .parcelrc
{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.md": [
      "./scripts/parcel-transformer-md.mjs",
      "..."
    ]
  }
}

// package.json
{
  "private": true,
  "name": "parcel-bug",
  "scripts": {
    "dev": "parcel index.md"
  },
  "devDependencies": {
    "parcel": "^2.9.3",
  }
}
# cli command
npm run dev

馃 Expected Behavior

Parcel should fail with an error message that says that the file "./scripts/parcel-transformer-md.mjs" doesn't exist.

馃槸 Current Behavior

Parcel attempts to install the "scripts" package, presumable extracted from the plugin path, then fails:

$ npm run dev

> dev
> parcel index.md

Server running at http://localhost:1234

Installing scripts...
馃毃 Build failed.

@parcel/package-manager: Could not find module "scripts", but it was listed in package.json.
 Run your package manager first.

  /Users/keri/Projects/parcel-bug/package.json:9:5
     8 |     "parcel": "^2.9.3",
  >  9 |     "scripts": "^0.1.0"
  >    |     ^^^^^^^^^ Defined here, but not installed
    10 |   }
    11 | }

馃捇 Code Sample

# extract contents and run the following commands to reproduce
npm i
npm run dev

parcel-bug.zip

馃實 Your Environment

Software Version(s)
Parcel parcel 2.9.3
Node node 20.5.1
npm/Yarn npm 9.8.0
Operating System macOS 13.5.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants