Skip to content

Fix ES6 import strategy #1594

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

Merged
merged 2 commits into from
May 24, 2019
Merged

Fix ES6 import strategy #1594

merged 2 commits into from
May 24, 2019

Conversation

Richienb
Copy link
Contributor

@Richienb Richienb commented May 4, 2019

Using the old import strategy, the following error is produced:

Uncaught TypeError: Promise is not a constructor

It's been fixed in this PR.

@benjamingr
Copy link
Collaborator

There's something wrong with your build - the way you fixed it too shouldn't technically work because the export is Promise and there is no named export (which is not destructuring)

@Richienb
Copy link
Contributor Author

Richienb commented May 4, 2019

@benjamingr That's strange. Anyways, here's a link to the repo that had this problem.

@Gp2mv3
Copy link

Gp2mv3 commented May 9, 2019

We had the exact same issue in a React Native app

@Richienb
Copy link
Contributor Author

@benjamingr It seems as if the import can spontaneously stop and start working. As a result, we can just add the replacement to the docs instead of replacing the current code.

@petkaantonov petkaantonov merged commit 3cf64ce into petkaantonov:master May 24, 2019
@Richienb Richienb deleted the patch-1 branch May 25, 2019 00:18
@isaac-deephealth
Copy link

isaac-deephealth commented Mar 10, 2025

Coming from Node 22 with ESM and Typescript (NodeNext Module resolution). For some reason the default import must be named the same as the Exported member

import Bluebird from 'bluebird';

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

Successfully merging this pull request may close these issues.

5 participants