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

fallback on Promise #810

Closed
wants to merge 1 commit into from
Closed

fallback on Promise #810

wants to merge 1 commit into from

Conversation

mcshaz
Copy link
Contributor

@mcshaz mcshaz commented Mar 22, 2019

When building against esNext window.Promise, Node.Promise etc. do not seem to exist, resulting in a runtime error in the code when running on Node. While this change could be regarded as a hack, it allows Dexie to run.

When building against esNext window.Promise, Node.Promise etc. do not seem to exist, resulting in a runtime error in the code when running on Node.  While this change could be regarded as a hack, it allows Dexie to run.
@dfahlander
Copy link
Collaborator

The problem is that Promise is defined locally so it would fallback to Dexie.Promise instead of the native Promise. Could be fixed by renaming function Promise to something else in promise.js. If so, we wouldn't have to pick _global.Promise at all but instead refer to it as just Promise.

@mcshaz
Copy link
Contributor Author

mcshaz commented Mar 22, 2019

OK - thanks for the quick response. I'll close this pull request and open an issue. hopefully I get time to get around to it. I will have to have a much deeper look into the differences between a dexie.Promise and the ES native promise.

@mcshaz mcshaz closed this Mar 22, 2019
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.

None yet

2 participants