garycourt / uri-js

An RFC 3986 compliant, scheme extendable URI parsing/validating/normalizing/resolving library for JavaScript
Other
305 stars 69 forks source link

ReferenceError: Unknown plugin "external-helpers" #21

Closed chrisg86 closed 7 years ago

chrisg86 commented 7 years ago

Hello, I receive the following error when trying to build with webpack:

Module build failed: ReferenceError: Unknown plugin "external-helpers" specified in "workspace/node_modules/uri-js/.babelrc" at 0, attempted to resolve relative to "workspace/node_modules/uri-js"
    at workspace/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (workspace/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (workspace/node_modules/babel-core/lib/transformation/file/options/option-manager.js:233:36)
    at OptionManager.init (workspace/node_modules/babel-core/lib/transformation/file/options/option-manager.js:367:12)
    at File.initOptions (workspace/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (workspace/node_modules/babel-core/lib/transformation/file/index.js:139:24)
    at Pipeline.transform (workspace/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (workspace/node_modules/babel-loader/lib/index.js:38:20)
    at Object.module.exports (workspace/node_modules/babel-loader/lib/index.js:133:12)
 @ ./static/js/main.js 3:0-17
 @ multi ./static/js/main.js

I am referencing the file like this:

import 'uri-js';

My webpack config only makes use of babel-loader:

{
  test: /\.js$/,
  use: 'babel-loader'
}

Any idea where this comes from?

garycourt commented 7 years ago

babel-loader appears to be using the .babelrc file in the project root, which was meant only to be used internally. Installing the package babel-plugin-external-helpers would probably solve your error message.

garycourt commented 7 years ago

I just pushed a new version of URI.js without this file. Try again and see if it fixes your problem.

chrisg86 commented 7 years ago

Thanks this worked :+1: You're awesome.