sindresorhus/debounce

snowpack failed to compile. 'debounce' is not exported by node_modules/debounce/index.js,

Tatametheus opened this issue · 6 comments

react use measure is depended on debounce. I got error during the compile time.

 snowpack failed to load node_modules/react-use-measure/dist/web.js
  'debounce' is not exported by node_modules/debounce/index.js, imported by node_modules/react-use-measure/dist/web.js

I have a similar issue with Vite. Neither of these work:

import debounce from "debounce"
import { debounce } from "debounce"
import * as debounce from "debounce"

I modified the code in a package where this is used as such:

import { default as debounce } from "debounce"

And that at least compiled through snowpack

This seems to break with https://esm.sh and deno as well...

TypeError: The requested module '/v43/debounce@1.2.1/deno/debounce.js' does not provide an export named 'debounce'

Experiencing the same issue with Rollup

Experiencing the same issue with Rollup

For rollup use plugin @rollup/plugin-commonjs

import debounce from 'debounce' should work fine.