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

cucumber-expressions: add dependency on util #1250

Closed
kubijo opened this issue Nov 17, 2020 · 2 comments
Closed

cucumber-expressions: add dependency on util #1250

kubijo opened this issue Nov 17, 2020 · 2 comments

Comments

@kubijo
Copy link

kubijo commented Nov 17, 2020

Summary

Webpack 5 has droped automatic pollyfilling of builtin nodejs modules so now we have this error:

Error: Webpack CompLooked for and couldn't find the file at the following paths:resolve 'util' in '/home/dan/work/braiins/main/web-ui/.yarn/unplugged/cucumber-expressions-npm-5.0.18-9e757759dc/node_modules/cucumber-expressions/dist/src'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

Possible Solution

add util to dependencies of cucumber-expressions

Your Environment

We use cypress with cypress-cucumber-preprocessor & cypress-webpack-preprocessor-v5 (a temporary fork of @cypress/webpack-preprocessor for webpack 5 support until official release)

@aslakhellesoy
Copy link
Contributor

We only use util.deprecate and util.format in a few places. I'd prefer a solution that removes the dependency on util altogether.

  • We can remove the deprecated functions in the next major release, so util.deprecate is no longer needed.
  • We can replace util.format with a simple function.

@aslakhellesoy aslakhellesoy added the 🐛 bug Defect / Bug label Nov 18, 2020
@kubijo
Copy link
Author

kubijo commented Nov 18, 2020

That is a good point & the process of making our aforementioned setup is more complex anyway.

In general it is good to have less dependencies anyway (for more than security reasons, but those should suffice) & ideally non that are bound to specific platform (node, browser) if that is not necessary…

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

No branches or pull requests

2 participants