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

Mongoose 6.6.6 fails to build browser.umd.js file and the released module contains build result from 5.13.15 #12576

Closed
2 tasks done
maciasello opened this issue Oct 21, 2022 · 4 comments
Milestone

Comments

@maciasello
Copy link
Contributor

maciasello commented Oct 21, 2022

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

6.6.6

Node.js version

18.7.0

MongoDB server version

Typescript version (if applicable)

Description

npm run build-browser fails on the current master. Even then it reports Browser build successful.. Despite that the published package contains dist/browser.umd.js, which is equal to the one built (successfully) from 5.x branch.

Steps to Reproduce

Failing build:

$ git switch master
$ git clean -f -x .
$ npm i
$ npm run build-browser

> mongoose@6.6.6 build-browser
> node ./scripts/build-browser.js

Starting browser build...
assets by status 1.47 KiB [cached] 1 asset
./browser.js 39 bytes [built] [code generated] [1 error]

ERROR in ./browser.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/preset-env' imported from /home/maciek/repos/oss/mongoose/babel-virtual-resolve-base.js
    at new NodeError (/home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2795:5)
    at packageResolve (/home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3451:9)
    at moduleResolve (/home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3485:18)
    at defaultResolve (/home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3524:13)
    at /home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3547:14
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:63:103)
    at _next (/home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:194)
    at /home/maciek/repos/oss/mongoose/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:364
    at new Promise (<anonymous>)

webpack 5.74.0 compiled with 1 error in 211 ms
Browser build successful.

Identical browser.umd.js files:

$ wget -O mongoose-6.6.6-browser.umd.js https://unpkg.com/mongoose@6.6.6/dist/browser.umd.js
$ wget -O mongoose-5.13.15-browser.umd.js https://unpkg.com/mongoose@5.13.15/dist/browser.umd.js
$ diff mongoose-5.13.15-browser.umd.js mongoose-6.6.6-browser.umd.js
<empty output means no diff>

Also verified on the local build on 5.x branch.

Expected Behavior

dist/browser.umd.js on branch 6.6.6 builds and contains relevant content.

@maciasello
Copy link
Contributor Author

I can confirm that build 6.6.5 also contains 5.13.15's dist/browser.umd.js file (checked because it is the last release mentioned on GH).

@vkarpov15 vkarpov15 added this to the 6.6.7 milestone Oct 21, 2022
@vkarpov15
Copy link
Collaborator

I'm so sorry for this issue. We will fix this and ship 6.6.7 today.

@maciasello
Copy link
Contributor Author

@vkarpov15 No worries! Please verify if fixing that doesn't close gh-12392 in one shot.

vkarpov15 added a commit that referenced this issue Oct 21, 2022
fix: correct browser build and improve isAsyncFunction check for browser
@vkarpov15
Copy link
Collaborator

Fixed by #12577

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

2 participants