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
Can't resolve 'pnpapi' with webpack 5.4.0 #263
Comments
Whats in this line? src/js/App.js 2:0-35 |
I stopped getting the aformentioned error by changing
I don't know if this was the correct way to go about this though... |
yes it removes the error, |
webpack 5.16.0 |
Somebody can create reproducible test repo? |
Issue webpack#263 is preventing my company from upgrading to Webpack v5. This was the proposed fix that worked well for us so I created a PR.
@alexander-akait : https://github.com/ferdinando-ferreira/enhanced-resolve-pnpapi-bug
|
I'm still getting this error, but with yarn berry.
|
Exact same error as @DavidTanner here, using enhanced-resolve 5.9.2, Yarn 3.2.0 and Jest 27.5.1. Repro: https://github.com/jscheid/enhanced-resolve-263 |
I'm currently experiencing the same as @jscheid with the same exact versions of those dependencies. |
I've opened #349, which seems to be patching the issue locally for me. There's got to be a better way, but maybe the approach taken in that PR is good enough to provide a workaround for now? |
Aha! Things seem to work as expected if |
@louisscruz please try latest webpack |
@vankop I'm on the latest webpack (5.73.0) but still seeing this error. |
Hi all, I'm having the same problem. I'm on yarn v1.22.19, webpack 5.73.0, with enhanced-resolve 5.10.0.
Is there a way to fix this without locally hacking my node_modules? |
…e yarn_v3.1.1_pnp_spec.ts system test. see webpack/enhanced-resolve#263 for more details
…e yarn_v3.1.1_pnp_spec.ts system test. see webpack/enhanced-resolve#263 for more details
…e yarn_v3.1.1_pnp_spec.ts system test. see webpack/enhanced-resolve#263 for more details
…e yarn_v3.1.1_pnp_spec.ts system test. see webpack/enhanced-resolve#263 for more details
* chore: [run ci] does further prerequisites for webpack 5: https://webpack.js.org/migrate/5/#make-sure-your-build-has-no-errors-or-warnings https://webpack.js.org/migrate/5/#make-sure-to-use-mode https://webpack.js.org/migrate/5/#update-outdated-options https://webpack.js.org/migrate/5/#test-webpack-5-compatibility app builds and runs locally. Time to test out in CI and see if buffer or process need to be polyfilled by the build * chore: upgrade to webpack 5 and do the bare minimum to get it working * chore: get @packages/extension working * chore: add TODOs to finish after webpack 5 update * chore: update the webpack config for npm/webpack-batteries-included-preprocessor to be webpack 5 compliant * chore: patch whatwg-url 7.1.0. package 'source-map' uses whatwg-url@7.1.0 which has a dependency on punycode node expected API. since punycode is now polyfilled for us implicitly via the punycode npm package, the API signatures are a bit different https://github.com/mathiasbynens/punycode.js/blob/main/punycode.js#L101 vs https://nodejs.org/api/punycode.html#punycodeucs2. The patch uses the punycode npm package expected API and is needed for source maps to work for cy.origin() dependencies for Cypress.require() * chore: convert whatwg patch into dev patch as source-map is not installed when building the binary / installing prod dependencies * chore: only move production level patches into the binary dist directory for yarn install --production * chore: remove --openssl-legacy-provider code for node versions 17 and over as webpack has been updated to v5 * chore: fix the webpack-batteries-included-preprocessor tests by shimming the correct node globals and built ins * chore: provide the define plugin and evalDevtoolPlugin again as we need define in order to build the react-dom library correctly in the bundle to not include the development version * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: fix the webpack preprocessor not to change promise references under the hood when compiling the first bundle, as it was causing the webpack preprocessor to hang as the reference itself was different * chore: fix issues from readFile that were caused by Webpack 5 using 'path-browserify' * chore: update chrome component testing snapshots to match Webpack 5 changes * chore: fix mismatched snapshots from webpack 5 update * chore: use Cypress.Buffer instead of Buffer for selectFile system test to avoid having to polyfill Buffer from webpack * chore: fix system test webpack path that now includes e2e workspace * chore: patch enhanced-resolve to properly discover the pnp api for the yarn_v3.1.1_pnp_spec.ts system test. see webpack/enhanced-resolve#263 for more details * chore: set stats to 'none' for experimentalSingleTabMode to prevent different webpack compiled terminal formatting in the snapshot between local and CI. * chore: fix node built in tests and configure webpack-batteries-included-preprocessor correctly * chore: fallback to buffer correctly in config, even though there is no impact due to the provide plugin * Update binary-cleanup.js to exclude added build dependencies for webpack 5 added by webpack-terser-plugin under the hood * chore: add stream-browserify to webpack preprocessor batteries included as a dep as its used in the config [run ci] * chore: make sure process and buffer are installed in the CLI for webpack provide * chore: build cross platform binaries [run ci] * chore: fix webpack evalDevToolPlugin instantiation [run ci] * run all binary jobs [run ci] * chore: updating v8 snapshot cache * add find-up to the entry points that need to be kept * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: fix mocha build warnings * chore: fix STRIPPED_INTEGRITY_TAG import warnings * chore: add changelog event --------- Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Here's my package.json as well
From what I've heard, pnpapi is built into webpack now, and that might be causing some conflict? I commented out line 118 in lib/ResolverFactory.js and webpack compiles fine after that.
The text was updated successfully, but these errors were encountered: