23 / resumable.js

A JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable/restartable uploads via the HTML5 File API.
MIT License
4.66k stars 611 forks source link

esModuleInterop error when using Typescript #547

Open junalmeida opened 4 years ago

junalmeida commented 4 years ago

This is the exception I am facing when using typescript:

This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.ts(2497)
junalmeida commented 4 years ago

Update: This might be already solved on version 1.1.2 however this version is not yet available on npm.

RobDaPraia commented 4 years ago

Problem is in the resumable.d.ts, almost the last line: export = Resumable.Resumable;

have a look at the latest version: https://github.com/23/resumable.js/blob/master/resumable.d.ts export = Resumable;

You can update the file under \node_modules\resumablejs\resumable.d.ts

But probably this manual change will be overwritten when doing a "npm install"

junalmeida commented 4 years ago

@RobDaPraia yes, this means changing that file manually is not an option.

bjoveski commented 4 years ago

Hey folks,

Thank you for developing Resumable, it's very well designed & documented and a pleasure to use.

Would you mind pushing the latest version (1.1.2) to the npm registry?

Thank you, Bojan

asmanp2012 commented 3 years ago

+