question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`node_modules/cypress/types/net-stubbing.ts` should be a `.d.ts` file

See original GitHub issue

Current behavior

When using Cypress as a library, there is one file called node_modules/cypress/types/net-stubbing.ts which only contains type definitions. Together with latest version of API extractor, this creates the error:

Error: <project>/node_modules/cypress/types/net-stubbing.ts:1:1 - (ae-wrong-input-file-type) Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension. Troubleshooting tips: https://api-extractor.com/link/dts-error

Error description advises to report the problem to the package maintainers…

This file seems to be created during build in the post install script.

The error is not detected by older versions of API extractor (not present with 7.20.1 but present with 7.25.2). This file was already here in older versions of Cypress (I can see the error on Cypress 8.4.1).

Desired behavior

Cypress should export its typing in .d.ts files rather than in .ts ones.

Test code to reproduce

Github action failing on that problem.

Cypress Version

8.4.1, 10.1.0

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mjhenkescommented, Jun 22, 2022

@Jym77 Would you be able to submit a PR for this issue?

0reactions
cypress-bot[bot]commented, Aug 2, 2022

Released in 10.4.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v10.4.0, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Modules .d.ts - TypeScript
One style of exporting in CommonJS is to export a function. Because a function is also an object, then extra fields can be...
Read more >
About "*.d.ts" in TypeScript - Stack Overflow
The "d.ts" file is used to provide typescript type information about an API that's written in JavaScript. The idea is that you're using...
Read more >
What is a “.d.ts” file in TypeScript? | by Ohans Emmanuel
d.ts files are called type declaration files. They exist for one purpose only: to describe the shape of an existing module and they...
Read more >
What Are *.d.ts files? How to Use *.d.ts Files in TypeScript?
How to use *. d. ts files. ... try restarting your device. Your browser can 't play this video. ... 51K views 2...
Read more >
Typescript should auto aquire d.ts files from npm package #9819
Why can't typescript just go through the node_modules and import all d.ts files in the lib folder of the respective packages? Just way...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found