-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Changes in 7.2.0 break external reporters #1646
Comments
Cucumber 7.2.0 introduced breaking changes, so I'm dropping the version range for now. See cucumber/cucumber-js#1646
Just to quickly clarify, this only occurs when using I had noticed the issue with pretty as well today, I will look at the impact of expanding what we export on the main entry point. Most looks reasonable but we'll need to be careful as we're effectively adding new things to the API contract which undoing later would be a breaking change. |
Hi @davidjgoss!
No, the issue occurs whenever an external project tries to import any sub-module from I've reproduced the issue here - https://github.com/jan-molak/cucumber-js-1646
See error:
|
Okay, 7.2.1 is out with a revert, I'll dig back into the ESM thing and see if there's a way we can avoid this issue. Thanks for raising @jan-molak |
Cucumber 7.2.0 introduced a breaking change, which 7.2.1 has reverted. See cucumber/cucumber-js#1646
Thanks for responding so quickly, @davidjgoss! |
2021-11-26T08:26:07.081Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialise "@wdio/cucumber-framework". |
Are you able to make it work with a version of cucumber < 7.2.0? 7.1.0 for example? The error reported looks like it is related to ESM support (I thing an error Are you trying to use the Would you mind open a dedicated issue? I don't think it is related to this one despite the error message looking the same |
Hi @aurelien-reeves I am not using formatter/helpers/event_data_collector by myself in code anywhere and while executing tests in wdio i am getting below error.
|
A reproducible example would be really helpful here Which version of wdio are you using? Did you asked their support? |
Given the file path of the error:
This suggests that |
I think those imports in the import EventDataCollector from '@cucumber/cucumber/lib/formatter/helpers/event_data_collector'
import { ITestCaseHookParameter } from '@cucumber/cucumber/lib/support_code_library_builder/types'
import { IRuntimeOptions } from '@cucumber/cucumber/lib/runtime' I've mentioned those and other useful (from a framework developer's perspective ;) ) imports in the original post.
Hope this helps |
@jan-molak thanks! Those deep imports should be working in 8.0.0-rc1, it's just the
|
Hi Davidjgoss, I am facing the same issue. have you resolved this issue? if yes, please let me know the solution of it because I am stuck in this and need to deliver the sprint. |
@abad786 the issue you have quoted has been fixed. Please make a try updating cucumber to 7.2.1 or to 8.0.0-rc.2 |
Thanks @aurelien-reeves and team for fixing it. |
Hey @davidjgoss and @charlierudolph!
It looks like support for ESM introduced in
7.2.0
(#1589) breaks a number of external reporters, as it no longer allows for sub-module imports.This manifests itself with an error in projects that attempt a sub-module import.
For example, calling either:
or:
results in:
Affected projects I'm aware of (there could be more):
@serenity-js/cucumber
module relies on following sub-module imports:@cucumber/cucumber/package.js
(to read the version)@cucumber/cucumber/lib/models/test_case_hook_definition
- to instantiateTestCaseHookDefinition
cucumber-pretty-formatter
- see Breaks with @cucumber/cucumber v7.2.0 cucumber-js-pretty-formatter#2, which relies on loading:@cucumber/cucumber/lib/formatter
-IFormatterOptions
@cucumber/cucumber/lib/formatter/helpers
-formatLocation
@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser
-getGherkinExampleRuleMap
,getGherkinScenarioMap
,getGherkinStepMap
@cucumber/cucumber/lib/formatter/helpers/pickle_parser
-getPickleStepMap
@wdio/cucumber-framework
, which loads:@cucumber/cucumber/lib/support_code_library_builder/types
-ITestCaseHookParameter
@cucumber/cucumber/lib/formatter/helpers/event_data_collector
-EventDataCollector
@cucumber/cucumber/lib/support_code_library_builder/types
-ITestCaseHookParameter
@cucumber/cucumber/lib/runtime
-IRuntimeOptions
Would it be possible for Cucumber.js to export the above classes, types, and functions, for example under
reporters
namespace (or something similar so that they don't get in the way of regular users):Alternatively, would it be possible to revert those changes if the above proposal requires too much work?
Thanks,
Jan
The text was updated successfully, but these errors were encountered: