jonathantneal / closest

Return the closest element matching a selector up the DOM tree

Home Page:http://caniuse.com/#feat=element-closest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No default export

binarykitchen opened this issue · comments

When I am trying to bundle an app of mine with rollup, I get this error

$ rollup -c etc/rollup/dev.js -w 
bundling...
...                                                                                                                                         ^

⚠️   'default' is not exported by 'node_modules/element-closest/element-closest.js'
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
commonjs-proxy:/home/michael-heuberger/code/videomail-client/node_modules/element-closest/element-closest.js (1:179)
1: import * as elementClosest from "/home/michael-heuberger/code/videomail-client/node_modules/element-closest/element-closest.js"; export default ( elementClosest && elementClosest['default'] ) || elementClosest;

looks like there is no default export for your library?

@binarykitchen Of course not. It's a polyfill.

import 'element-closest';

oh right, thanks!