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

Build fails on master in Windows #4548

Closed
0xwang-coder opened this issue Nov 22, 2019 · 11 comments · Fixed by #4549 or GulajavaMinistudio/jquery#113
Closed

Build fails on master in Windows #4548

0xwang-coder opened this issue Nov 22, 2019 · 11 comments · Fixed by #4549 or GulajavaMinistudio/jquery#113

Comments

@0xwang-coder
Copy link

0xwang-coder commented Nov 22, 2019

Env:win10 1909
Node.js:both v8.11.4 and v12.13.1
When I run 'npm run build',there is a error as below:

Running "build:all:*" (build) task Warning: "var/arr.js" does not exist in the hypothetical file system! Use --force to continue. Aborted due to warnings. npm ERR! code ELIFECYCLE npm ERR! errno 3 npm ERR! jquery@4.0.0-pre build:npm install && grunt` npm ERR! Exit status 3 npm ERR! npm ERR! Failed at the jquery@4.0.0-pre build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! E:\npm_modules\npm_cache_logs\2019-11-22T14_45_16_106Z-debug.log

**then, I viewed the log**:13 verbose stack Error: jquery@4.0.0-pre build: npm install && grunt
13 verbose stack Exit status 3
13 verbose stack at EventEmitter. (D:\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess. (D:\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid jquery@4.0.0-pre
15 verbose cwd E:\workspace\jquery
16 verbose Windows_NT 10.0.18363
17 verbose argv "D:\nodejs\node.exe" "D:\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
18 verbose node v12.13.1
19 verbose npm v6.12.1
20 error code ELIFECYCLE
21 error errno 3
22 error jquery@4.0.0-pre build: npm install && grunt
22 error Exit status 3
23 error Failed at the jquery@4.0.0-pre build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3, true ]
`
I cant got what I can do.

@mgol
Copy link
Member

mgol commented Nov 22, 2019

I can't reproduce the issue on macOS Catalina. @dmethvin does it work OK for you on Windows?

@wangwanchao Can you try removing the node_modules and then running npm run build again? Make sure you're on the latest master.

@0xwang-coder
Copy link
Author

0xwang-coder commented Nov 24, 2019

I can't reproduce the issue on macOS Catalina. @dmethvin does it work OK for you on Windows?

@wangwanchao Can you try removing the node_modules and then running npm run build again? Make sure you're on the latest master.

I removed the node_modules under jquery and run npm run build, there is error like before.
then,I checkout 3.x-stable, build successfully.

@mgol
Copy link
Member

mgol commented Nov 24, 2019

Sorry, I forgot: remove both node_modules & package-lock.json & then try npm run build.

@dmethvin
Copy link
Member

Also getting an error here on Windows. Maybe an issue with path separators? I'm seeing a similar problem, but on core.js for some reason. The error message points to an issue with rollup-plugin-hypothetical. If I add leaveIdsAlone: true to the build options it makes the problem go away and the build succeeds.

@timmywil timmywil changed the title build error Build fails on master in Windows Nov 25, 2019
@timmywil timmywil added this to the 3.5.0 milestone Nov 25, 2019
@mgol
Copy link
Member

mgol commented Nov 25, 2019

@dmethvin I don't think that would work. The option you mentioned means the plugin doesn't resolve paths but treats them as strings. If those strings match, an override is served. The issue is our build process puts absolute paths into that plugin so they'd essentially all become unmatched - which means the default build would work but all of our include/exclude options would be ignored, breaking custom compilation.

The current configuration of our build means: if there is any override in what we pass to the plugin, use that as the source. The issue is with that second part. It looks like a bug in rollup-plugin-hypothetical, most likely lemmabit/rollup-plugin-hypothetical#5.

Unfortunately, the last version of that package was published 2 years ago... I'm not sure how actively it's maintained. That said, we only need a tiny part of that package functionality so I might as well go with the nuclear option & re-implement what we need in a small custom plugin lying in our repo. For what we need, it shouldn't be too hard, Rollup's plugin API surface is quite small: https://rollupjs.org/guide/en/#plugins-overview

@mgol mgol self-assigned this Nov 25, 2019
@mgol mgol modified the milestones: 3.5.0, 4.0.0 Nov 25, 2019
@mgol
Copy link
Member

mgol commented Nov 25, 2019

@timmywil I modified the milestone to 4.0.0 as this code is only on master and the 3.x-stable branch builds fine.

@mgol mgol added Build and removed Needs review labels Nov 25, 2019
mgol added a commit to mgol/jquery that referenced this issue Nov 26, 2019
This commit gets rid of rollup-plugin-hypothetical in favor of a simpler
inline Rollup plugin that fits our need and is compatible with Windows.

Fixes jquerygh-4548
@mgol mgol mentioned this issue Nov 26, 2019
2 tasks
@mgol
Copy link
Member

mgol commented Nov 26, 2019

PR: #4549

@0xwang-coder
Copy link
Author

I had removed node_modules, and run npm run build, but there is error like before, what somthing I can to do?

@mgol
Copy link
Member

mgol commented Nov 27, 2019

@wangwanchao Did you try it on my branch? This is a PR, it's not merged yet.

@0xwang-coder
Copy link
Author

0xwang-coder commented Nov 27, 2019

@mgol sorry,according to what you said,I checkout branch rollup-windows-fix,build successfully. Thanks.

@mgol
Copy link
Member

mgol commented Nov 27, 2019

@wangwanchao Thanks for confirming!

@mgol mgol closed this as completed in #4549 Dec 2, 2019
mgol added a commit that referenced this issue Dec 2, 2019
This commit gets rid of rollup-plugin-hypothetical in favor of a simpler
inline Rollup plugin that fits our need and is compatible with Windows.

Fixes gh-4548
Closes gh-4549
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

4 participants