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

Investigate upgrading Gulp, Webpack and Node.js dependencies #10177

Closed
timvandermeij opened this issue Oct 23, 2018 · 5 comments
Closed

Investigate upgrading Gulp, Webpack and Node.js dependencies #10177

timvandermeij opened this issue Oct 23, 2018 · 5 comments
Labels

Comments

@timvandermeij
Copy link
Contributor

From #10176:

Webpack is pinned because versions higher than this cause the viewer not
to work (see https://github.com/mozilla/pdf.js/pull/10170#issuecomment-431697032).

Node.js is pinned for Travis CI because version 11 requires that we
update to Gulp 4.
@Snuffleupagus
Copy link
Collaborator

Webpack is pinned because versions higher than this cause the viewer not to work (see #10170 (comment)).

The problem is that Webpack, starting from version 4.22.0, is now parsing the entire

typeof __non_webpack_require__ !== 'undefined'

expression during the build process, causing the above line to be reduced to true.
The expected, and previous output, is that __non_webpack_require__ is replaced with require as

typeof require !== 'undefined'

According to the documentation, this should still work; see https://webpack.js.org/api/module-variables/#__non_webpack_require__-webpack-specific-

If someone has time (since a reduced test-case might be needed), this should be reported to https://github.com/webpack/webpack/issues

@timvandermeij
Copy link
Contributor Author

Gulp and Node.js are taken care of in the meantime, only Webpack remains.

@Snuffleupagus
Copy link
Collaborator

Was the Webpack regression described in #10177 (comment) ever reported upstream, or has it perhaps already been fixed in a later release?

(You could probably hack around this on the PDF.js side, by using e.g. PDFJSDev.eval or similar, but that would IMHO be a last resort if the Webpack regression isn't fixed.)

@timvandermeij
Copy link
Contributor Author

timvandermeij commented Feb 23, 2019

I tried the latest release last time I updated the dependencies and it isn't fixed yet, nor do I really know how to report this in a way that it's actionable for upstream because I don't know that much about this part of the codebase to reduce it to a minimal example.

@timvandermeij
Copy link
Contributor Author

I have filed an upstream issue for this bug at webpack/webpack#8829. If that is fixed, we can remove the workaround. Tracking this upstream now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants