-
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
Type definitions export ES Modules but should export CommonJS #151
Comments
Please check step 2 from install part of readme. Based on that I think this duplicates #148 |
|
Can you please check the demo project from readme, using this plugin? That is also with typescript and it's working. Check for difference against your setup. |
The difference is the Cypress config file in your demo uses ES imports: https://github.com/archfz/cypress-terminal-report-demo/blob/7d3c107bf102d0280b01431b3f518c5169561f73/cypress.config.ts#L2 Whereas the config file in my reduced test case is using a CommonJS I think this tool should support config files with CommonJS as this is supported by Cypress. I have explained a way to fix this above. |
Ok thank you. PRs are welcome btw. |
Released fix in 4.0.2. Please test. |
#151: Fix typescript declaration for support for both commonjs and esm.
Reduced test case: https://github.com/OliverJAsh/cypress-10-cypress-terminal-report-errors
This is a brand new Cypress project.
Run
yarn
and thentsc
.This is happening because the type definitions are defined using ES Modules (
export default installLogsPrinter;
) however they should be defined as CommonJS (export = installLogsPrinter;
) to match the JS source code.cypress-terminal-report/src/installLogsPrinter.d.ts
Line 113 in c7d74ce
cypress-terminal-report/src/installLogsPrinter.js
Line 324 in c7d74ce
https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require
Related change: 59f0ab9#diff-2a909c3c7c488c66f7e2c41d5b33f5c0f062d164a5a5e47485318e0697a0d7adL87
Related issue: #149
The text was updated successfully, but these errors were encountered: