Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: to is not a function #51

Open
euoia opened this issue May 19, 2021 · 3 comments
Open

TypeError: to is not a function #51

euoia opened this issue May 19, 2021 · 3 comments

Comments

@euoia
Copy link

euoia commented May 19, 2021

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.

@micalevisk
Copy link

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 🤔

await-to-js/package.json

Lines 11 to 12 in ed778a0

"main": "dist/await-to-js.umd.js",
"module": "dist/await-to-js.es5.js",

Tested with Node v16.14.2

@dkebler
Copy link

dkebler commented Apr 25, 2023

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

@ghost
Copy link

ghost commented Apr 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants