-
Notifications
You must be signed in to change notification settings - Fork 292
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
upgrade to webpack v5 stable version #602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the watcher API changed causing the test to fail.
Previously, it was changed from expect(missing.length).toBeGreaterThan(100)
to expect(missing._set.size).toBeGreaterThan(100)
in PR #579 so perhaps you could try changing it back?
looks like the previous code doesn't work as well. I logged the |
webpack 5.0.0-beta.29 includes a fixing "fix watching when more than 2000 directories are watched on MacOS", could this be related to it? sounds like webpack tried to reduce the watchers count, so less than 100 might be expected? |
But the failures are only happening on Linux, macOS passes CI |
Note added: sometimes the CI failed with test "Should support custom watch API" that |
Sounds like a webpack bug? |
FoundingI'm doubting it's a issue while webpack working with twilio.js since twilio requires native nodejs module and webpack 5 won't polyfill them. I created a gist to run webpack@5 with custom watch (same with watcher.test.js) to compile twilio.js (same with test/integration/twilio.js) 👉 link and I got logs below
currently ncc swallowed these errors that I can't see them even turn the webpack in webpack@5.0.0-beta.31 they add this change: add resolve.fallback option and recommend that for polyfilling. I guess that's why it breaks after bumping webpack version higher than beta-28. Followup
|
Nice find! I was thinking the Node.js fallback was removed during the webpack beta but I guess we are a bit outdated as you mentioned.
I think we need to have the Node.js fallback out of the box like the old webpack because ncc is designed specifically for Node.js |
test/watcher.test.js
Outdated
@@ -97,7 +97,7 @@ jest.setTimeout(30000); | |||
|
|||
it('Should support custom watch API', async () => { | |||
let buildCnt = 0; | |||
const buildFile = path.resolve('./test/integration/request.js'); | |||
const buildFile = path.resolve('./test/integration/twilio.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work work with request
now that node-libs-browser
is added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request.js will work for both whatever you add the nodejs lib fallback support or not. twilio.js doesn't work without fallback that breaks the watcher test case.
I changed the original file from twilio to request to let it pass the test in last commit.
src/index.js
Outdated
@@ -205,8 +205,7 @@ module.exports = ( | |||
mainFields: ["main"], | |||
plugins: resolvePlugins | |||
}, | |||
// https://github.com/vercel/ncc/pull/29#pullrequestreview-177152175 | |||
node: false, | |||
node: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is {}
different than false
?
I'm looking at the docs between v4 and v5 and the false
value seems to be the same for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was the root cause to trigger the error but looks like it just accidently passed tests..after rerun the tests they're still failed. reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder why CI gets passed now...seems the nodejs lib fallback wasn't the issue before? I'm still stucking at watcher test failure on my local laptop 🤔 ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, thanks!
since webpack 5 stable version is released, try to adopt it to ncc