Error importing TypeScript file into the configuration file - unknown file extension #30228
Unanswered
Ixluxi
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a package installed (one I created) that contains a TypeScript file called
test-data-utilities.ts
In my config file (
qa.config.ts
), I try to import it, but it imports (auto-completes) as.js
...import TestDataUtilities from '@mypackage/cypress-test-data-utilities/test-data-utilities.js'
So I switch '.js' to '.ts' and try to use the class:
const testDataUtilities = new TestDataUtilities()
I get error:
I have TypeScript installed in the framework, but does the package itself need to have TypeScript installed? (typescript is not present in the package's list of dependencies).
Thank you for any help you can provide.
EDIT: The work-around is to change my package file to js or bake the methods into each config file, which defeats the point of using TypeScript.
Beta Was this translation helpful? Give feedback.
All reactions