bug(types): error importing attachCustomCommands in typescript
josheverett opened this issue · 3 comments
Describe the bug
import { attachCustomCommands } from 'cypress-firebase';
fails with:
File /node_modules/cypress-firebase/index.d.ts' is not a module. ts(2306)
To Reproduce
- Install and configure
cypress
, verify you can run a hello world test. npm install --save-dev cypress-firebase firebase-admin
- Create
cypress/support/commands.ts
, following Setup guide from README:
import firebase from "firebase/app";
import "firebase/auth";
import "firebase/database";
import "firebase/firestore";
import { attachCustomCommands } from "cypress-firebase";
const fbConfig = {
// Your config from Firebase Console
};
firebase.initializeApp(fbConfig);
attachCustomCommands({ Cypress, cy, firebase });
-
TypeScript surfaces the following error in VSCode:
File <path>/node_modules/cypress-firebase/index.d.ts' is not a module. ts(2306)
-
To troubleshoot, I
npm install
ed another TypeScript-friendly zero-dependency module and imported it withincypress/support/commands.ts
. It produced no errors as expected.
Expected behavior/code
TypeScript correctly recognizes this file and its types.
Additional Context/Screenshots
Screenshot:
I'm also running into this.
Same here - did anyone find a work around?
I had to just // @ts-ignore
the import declaration.