23/resumable.js

esModuleInterop error when using Typescript

junalmeida opened this issue · 5 comments

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)

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

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"

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

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