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

fix: correct browser build and improve isAsyncFunction check for browser #12577

Merged
merged 1 commit into from Oct 21, 2022

Conversation

vkarpov15
Copy link
Collaborator

Re: #12576

Summary

A couple of related fixes:

  1. Fix the issue that was causing browser build to fail
  2. Remove dist to prevent accidentally publishing out-of-date browser build if build-browser fails
  3. Use a different approach for isAsyncFunction() based on this SO thread, because our current approach doesn't seem to work very well when compiled through Babel. I suspect the issue is that Babel converts Object.getPrototypeOf(async function() {}); to Object.getPrototypeOf(function() {}); under the hood.

Examples

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍

@clathey123
Copy link

I am using Node and Mongoose in a reactjs project. Yesterday I installed the validation module in NPM and did an audit fix. One of these actions triggered the issue with the browser.umd file that is described above. Today I went to verify the version of mongoose that I am using and I get an error "Invalid version mongoose". I went to the log file noted in this invalid version error and I found the attached text.

I am relatively new to this "world" and have no idea what I should do to resolve the initial 'split' issue or the invalid version. Can you help?

Thank you! Cheryl
2022-10-30T14_30_47_341Z-debug-0.log

@hasezoey
Copy link
Collaborator

@clathey123 next time please open a new issue

from the error verbose stack Error: Invalid version: mongoose and some doing searching, it seems you have set some package to version mongoose (ie set something like "some-package": "mongoose", which is a invalid version

@clathey123
Copy link

clathey123 commented Oct 30, 2022

Thanks for the reply... next time I will open a new issue. Sorry, I don't know how I would have set a package to "mongoose" or how to find or fix. I did a search for ": "mongoose" and did not find anything. Any ideas on how I would find and fix this?

@hasezoey
Copy link
Collaborator

Sorry, I don't know how I would have set a package to "mongoose" or how to find or fix. I did a search for ": "mongoose" and did not find anything. Any ideas on how I would find and fix this?

the only guess i would have is in the package.json, just search for mongoose, otherwise also maybe look into the lockfile if used (or try to delete the lockfile), aside from that, try to check that the syntax of the json is actually correct and not missing any characters
what could also be the problem is something in node_modules, try to remove and reinstall it

@clathey123
Copy link

clathey123 commented Nov 1, 2022 via email

@clathey123
Copy link

clathey123 commented Nov 2, 2022 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

Successfully merging this pull request may close these issues.

None yet

4 participants