Plugins: TypeError: resolve is not a function

Created on 4 Jun 2020  路  6Comments  路  Source: rollup/plugins

  • Rollup Plugin Name: @rollup/plugin-node-resolve
  • Rollup Plugin Version: 8.0.0
  • Rollup Version: 2.13.1
  • Operating System (or Browser): macOS 10.14.6
  • Node Version: 12.16.0

How Do We Reproduce?

I am trying to bundle Bootstrap using the configuration here https://github.com/twbs/bootstrap/blob/master/build/rollup.config.js.

I get an error on line 30 saying that resolve is not a function. Bootstrap uses version 7.1.3 of this plugin, whereas I updated to the latest 8.0.0 and since then I get the said message

Expected Behavior

v8.0.0 to bundle without any errors and work in the same way as v7.1.3 does

Actual Behavior

I get an error: TypeError: resolve is not a function

Most helpful comment

This works

const { nodeResolve } = require('@rollup/plugin-node-resolve');

All 6 comments

Looks like you need commonjs. Have you tried searching the issues here?

Looks like you need commonjs. Have you tried searching the issues here?

Yes I did, it might be similar to #412 but I am not 100% sure

This works

const { nodeResolve } = require('@rollup/plugin-node-resolve');

Thanks @zebapy

I was having the same issue. Should the main readme be updated to indicate this change? The examples listed there don't work...

@tborychowski there's a PR debating changes for that https://github.com/rollup/plugins/pull/456

Was this page helpful?
0 / 5 - 0 ratings