await-to-js icon indicating copy to clipboard operation
await-to-js copied to clipboard

TypeError: to is not a function

Open euoia opened this issue 3 years ago • 3 comments

When using this library, I needed to import with the following pattern:

import { to } from "await-to-js";

Instead of the approach in the README:

import to from "await-to-js".

Otherwise I would get an error:

TypeError: to is not a function

From adding logging to the library, it appears that the import statement is using await-to-js.umd.js and not await-to-js.es5.js.

Tested with Node v14.17.0 running as node index.mjs.

euoia avatar May 19 '21 07:05 euoia

import statement is using await-to-js.umd.js and not await-to-js.es5.js

indeed. I added a console.log on dist/await-to-js.es5.js but it was not evaluated; while the one at dist/await-to-js.umd.js does :thinking:

https://github.com/scopsy/await-to-js/blob/ed778a02ba60eaca5636a6fc7582f7b091d61e0c/package.json#L11-L12

Tested with Node v16.14.2

micalevisk avatar May 25 '22 13:05 micalevisk

still a problem two years later, please update the readme file or fix

dkebler avatar Apr 25 '23 16:04 dkebler

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。

ghost avatar Apr 25 '23 16:04 ghost