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
Trouble running .features file with webpack on windows #304
Comments
can you give it a try with the newest version (2.0.0)? Have you tried just running our example repo? it would be helpful to verify if things work/not work there. My native platform is not windows so the more you can give me here the easier my life will be ;) |
I forked the repo you mentioned and brought it up to date. The (new) issue is related to running cucumber in the "nonGlobal" folder style - I created an issue on that repo with a link to the fork. |
Hi! Any updates on this? Im having this exact issue when trying to make this work with Angular 9. What possible fix is there for this? |
@lgandecki Hey, this is a major issue for us, is there some way we can help? |
Just to reiterate - running .feature works, but .features doesn't and the problem is on windows with nonGlobal structure? |
@lgandecki we have the issue on linux, mac and windows. We use webpack for preprocessing and receive "cannot read property split of undefined" in cypress upon running the All.features file. our project is set-up using nrwl.io nx. Here's our plugins/index.js const { getWebpackConfig } = require('@nrwl/cypress/plugins/preprocessor');
const webpack = require('@cypress/webpack-preprocessor');
function preprocessTypescript(config) {
if (!config.env.tsConfig) {
throw new Error('Please provide an absolute path to a tsconfig.json as cypressConfig.env.tsConfig');
}
const webpackConfig = getWebpackConfig(config);
webpackConfig.node = { fs: 'empty', child_process: 'empty', readline: 'empty' };
webpackConfig.module.rules.push({
test: /\.feature$/,
use: [
{
loader: 'cypress-cucumber-preprocessor/loader',
},
],
});
webpackConfig.module.rules.push({
test: /\.features$/,
use: [
{
loader: 'cypress-cucumber-preprocessor/lib/featuresLoader',
},
],
});
return webpack({
webpackOptions: webpackConfig,
});
}
module.exports = (on, config) => {
on('file:preprocessor', preprocessTypescript(config));
}; |
@lgandecki if you scroll up there's a link to a fork with a repro. In summary, *.features is broken on Windows when using non-global steps. |
@lgandecki let me know if we can help in any way |
@sebastiandero, can you provide an example repo which allows us to merely clone, run npm install and observe the issue? |
@badeball https://github.com/alastair-todd/cypress-cucumber-webpack-typescript-example remember its a windows-only issue |
I don't run windows and unfortunately have no ability to reproduce your issue. @sebastiandero claims to observe this across all plattforms, hence I'm asking them. |
@badeball @lgandecki if you change it will work, but switching it back will break it again. Edit: run it using EDIT: here's the stacktrace
|
Alright, so what's happening is that I guess the method used for invalidating the browserify module cache doesn't quite work with webpack, which doesn't come as a huge surprise, really. Did this ever work and is the case now that it doesn't work with the most recent version? |
@badeball we have only started using the preprocessor two months ago, and we have always had this issue |
I think @badeball is right, this is where it throws: ( and it should be an error not string, indeed but that won't fix anything - besides being less cryptic. ) What actually happens here I believe is we need to make sure that importing the same file twice runs it's side effects, instead of just getting the cached export otherwise if you use the same file in nonGlobal feature things are not working right. It'd be easy to test by making that clearFromCache function empty and seeing how webpack behaves - maybe things will just work? (although I doubt it) @sebastiandero is this something you are able to research? :) Or is this too low level? |
@lgandecki I will do my best |
Does this work and if so, maybe it can be done conditionally based on whether |
@lgandecki @badeball @alastair-todd Hi, it took me a while to get some time, seems like webpack behaves correctly without explicitly deleting the cache, here's the PR -> #404 |
@alastair-todd please try again with the most recent version, should be fixed. |
we still have this issue while trying to run .feature file in cypress:6.3.0 |
I am using v1.17 with cypress 3.8.2 on windows and am having issues with
cypress run --spec **/*.features
I get
The project is set up with typescript.
I have created a repo for the issue.
The text was updated successfully, but these errors were encountered: