sindresorhus / debounce

Delay function calls until a set time elapses after the last invocation
Other
798 stars 80 forks source link

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

Closed Tatametheus closed 1 year ago

Tatametheus commented 4 years ago

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
stefandesu commented 4 years ago

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

import debounce from "debounce"
import { debounce } from "debounce"
import * as debounce from "debounce"
lannonbr commented 4 years ago

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

mashaal commented 3 years ago

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'
Pringels commented 3 years ago

Experiencing the same issue with Rollup

DominicLGit commented 2 years ago

Experiencing the same issue with Rollup

For rollup use plugin @rollup/plugin-commonjs

sindresorhus commented 1 year ago

import debounce from 'debounce' should work fine.