await-to-js
await-to-js copied to clipboard
TypeError: to is not a function
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
.
import statement is using
await-to-js.umd.js
and notawait-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
still a problem two years later, please update the readme file or fix
这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。