-
Notifications
You must be signed in to change notification settings - Fork 39
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
BaseOutputProcessor doesn't compatible with Webpack #32
Comments
You should not compile the plugins.js and support.js of cypress. Since you are using webpack only to transpile typescript you could remove js from the extensions and that might resolve it. Or otherwise set ignore pattern to not include this plugin into compilation. Node js require is native and core functionality of node.js modules. There is nothing we can do about this. |
Also please note that webpack gives error here for the fs module require. And since that is a native embedded module it doesn't actually have js code that is why its failing. The support.js (in your case support/index.js) is meant for node side loading on cypress. It will not be loaded in the browser. This file is exactly meant by cypress for usage of modules like os, fs and any other low level node api. |
Thanks for quick responding. I agreed that Looking at the cypress docs:
The folder is used for support code while running the tests. Also, the |
I looked into this a little bit closer. Sorry I actually mixed up the support file with the plugins file. Indeed this is an issue because this plugins support and plugin install both are loaded through the same index.js file. Thus the fs require ends up in the support.js as well. This will require a breaking change to improve on our side. Please still consider ignoring the support.js from compilation if that works. |
I tried to exclude the support.js file but it would make everything fail. I'm wondering before a proper fix/feature to address this, is it easy to add a new config field to not load that file at all? So that it at least won't break the projects with webpack. |
Actually you can fix this for now by requiring the specific files rather then the index in plugins and support. ex require('cypress-terminal-report/src/installLogsCollector.js'). Take a look in index.js. |
I had the same problem. I was able to get the plugin to work by installing the setup functions directly as @archfz suggested. Thank you very much for making this plugin and for providing a workaround for this issue! |
Released in 1.4.0 |
When working with webpack and its cypress plugin, the default webpack has
target: "web"
, which doesn't support the nativerequire
. Thus throw exceptions:webpack.config
Tried to change the target with
target: "node"
but it introduce new problems. Downgrade to v1.2.1 solved the problem.Please consider opt the default processor out of loading from the default config.
The text was updated successfully, but these errors were encountered: