use-debounce icon indicating copy to clipboard operation
use-debounce copied to clipboard

`MODULE_TYPELESS_PACKAGE_JSON` warning due to missing `"type": "module"`

Open clemeth opened this issue 10 months ago • 2 comments

When using the package, Node.js emits the following warning:

[MODULE_TYPELESS_PACKAGE_JSON] Warning: file:///[...]/node_modules/use-debounce/dist/index.module.js parsed as an ES module because module syntax was detected; to avoid the performance penalty of syntax detection, add "type": "module" to /[...]/node_modules/use-debounce/package.json

A "type": "module" declaration was added to package.json in 5a68494, but was subsequently removed in 3556a91.

It should be added back to avoid this warning.

Versions

use-debounce: 10.0.4
node: 22.8.0

clemeth avatar Jan 16 '25 21:01 clemeth

JFYI: for me it leads now to "Cannot use import statement outside a module" with latest react-router and vite

For anyone else who might come here using noExternal helped me

misha-erm avatar Jan 26 '25 10:01 misha-erm

It disappeared for me completely using Node.js version 22.12.

clemeth avatar Jan 26 '25 17:01 clemeth