simple-update-notifier icon indicating copy to clipboard operation
simple-update-notifier copied to clipboard

Incorrect default export

Open nicojs opened this issue 1 year ago • 1 comments

The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default.

image

See https://arethetypeswrong.github.io/?p=simple-update-notifier%402.0.0

nicojs avatar May 22 '24 13:05 nicojs

Current workaround:

import updateNotifierModule from 'simple-update-notifier';

/** @ts-expect-error: The types are wrong, see https://github.com/alexbrazier/simple-update-notifier/issues/29 */
const updateNotifier: typeof updateNotifierModule.default = updateNotifierModule;

nicojs avatar May 22 '24 13:05 nicojs