I've pulled this into my project from NPM and I'm trying to import it into a webcomponent but
import { humanizeDuration } from 'humanize-duration/humanize-duration.js'; gives an error that there is not export named humanizeDuration
So I tried
import 'humanize-duration/humanize-duration.js'; but this gives an error Uncaught (in promise) TypeError: Cannot set property 'humanizeDuration' of undefined from the following line 1118 code
humanizeDuration.humanizer = humanizer;
if (typeof define === 'function' && define.amd) {
define(function () {
return humanizeDuration;
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = humanizeDuration;
} else {
this.humanizeDuration = humanizeDuration;
}
})(); // eslint-disable-line semi
basically the last line of real code in the above snippet.
Any ideas how to get around it?
I've pulled this into my project from NPM and I'm trying to import it into a webcomponent but
import { humanizeDuration } from 'humanize-duration/humanize-duration.js';gives an error that there is not export namedhumanizeDurationSo I tried
import 'humanize-duration/humanize-duration.js';but this gives an errorUncaught (in promise) TypeError: Cannot set property 'humanizeDuration' of undefinedfrom the following line 1118 codebasically the last line of real code in the above snippet.
Any ideas how to get around it?