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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: pluginOpts.root.reduce is not a function #152

Closed
rohmanhm opened this issue Apr 2, 2017 · 2 comments
Closed

Error: pluginOpts.root.reduce is not a function #152

rohmanhm opened this issue Apr 2, 2017 · 2 comments

Comments

@rohmanhm
Copy link
Contributor

rohmanhm commented Apr 2, 2017

I found error

node_modules/babel-plugin-module-resolver/lib/index.js:67
    pluginOpts.root = pluginOpts.root.reduce(function (resolvedDirs, dirPath) {

Here's my .babelrc config

{
  "presets": [
    "next/babel",
    "latest",
    "stage-2"
  ],
  "plugins": [
    ["module-resolver", {
      "root": "./src",
      "alias": {
        "@": "./"
      }
    }]
  ]
}
@rohmanhm
Copy link
Contributor Author

rohmanhm commented Apr 2, 2017

ah, my bad. missing [] on my root key

@cazzer
Copy link

cazzer commented Jul 1, 2017

To save everyone else the click, the readme documents the following way to configure the plugin:

["module-resolver", {
  "root": ["./src"],
  "alias": {
    "@": "./"
  }
}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants