parcel: Unknown plugin "transform-es2015-arrow-functions" with basic project

Bug Report πŸ›

I created a minimal project (following https://parceljs.org/getting_started.html. The only difference is that I include the package β€œws” in package.json). Launching parcel via parcel index.html causes the error you can see below.

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

package.json

{
  "name": "dashboard",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "ws": "^3.3.3"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

πŸ€” Expected Behavior

Parcel bundles up the project without any problem.

😯 Current Behavior

⏳  Building...
Server running at http://localhost:1234
🚨  /usr/local/lib/node_modules/parcel-bundler/node_modules/browserify-zlib/lib/binding.js: Unknown plugin "transform-es2015-arrow-functions" specified in "/usr/local/lib/node_modules/parcel-bundler/node_modules/browserify-zlib/package.json" at 0, attempted to resolve relative to "/usr/local/lib/node_modules/parcel-bundler/node_modules/browseri    at /usr/local/lib/node_modules/parcel-bundler/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/usr/local/lib/node_modules/parcel-bundler/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/usr/local/lib/node_modules/parcel-bundler/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/usr/local/lib/node_modules/parcel-bundler/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/usr/local/lib/node_modules/parcel-bundler/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/usr/local/lib/node_modules/parcel-bundler/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at JSAsset.parse (/usr/local/lib/node_modules/parcel-bundler/src/assets/JSAsset.js:55:20)
    at JSAsset.parseIfNeeded (/usr/local/lib/node_modules/parcel-bundler/src/Asset.js:46:29)
    at <anonymous>

πŸ’ Possible Solution

No idea. The project is too small for anything to cause this error.

πŸ”¦ Context

Just trying out parcel to bundle the simplest project.

🌍 Your Environment

Software Version(s)
Parcel 1.2.0
Node v9.3.0
npm/Yarn npm 5.6.0
Operating System OSX 10.13.2

About this issue

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

Most upvoted comments

yarn add babel-plugin-transform-es2015-arrow-functions --dev OR npm install babel-plugin-transform-es2015-arrow-functions --save-dev Should fix your issue

Please close the issue if this resolved the bug

@DeMoorJasper @sergi im having the same issue… same situation

By investigating for a while I have myself a workaround. This might help anybody who encountered the same problem.

Instead of using parcel globally, I install it locally by npm install --save-dev parcel-bundler. Then I add a npm script like

  "scripts": {
    "start": "parcel ./index.html"
  }

Also I need preset-es2015 or I will get another issue.

npm install --save-dev babel-preset-es2015

Then use npm start for bundling and everything works.

This is probably #13.

If someone could provide a basic project with this bug than i could confirm if its a bug or how to actually fix this

Sent with GitHawk