TypeError: (0 , plugin_1.default) is not a function

See original GitHub issue
Screenshot 2022-05-18 at 7 42 26 PM

I m having issues starting up cypress open with error shown above screenshot

I have added cypress-visual-regression to tsconfig.json

{
  "compilerOptions": {
    "allowJs": true,
    "target": "es5",
    "lib": ["es5", "dom"],
    "types": ["cypress", "cypress-grep", "cypress-downloadfile", "cypress-visual-regression"]
  },
  "include": ["**/*.ts"]
}

e2e/cypress/support/index.js

`import './commands';`
....

e2e/cypress/plugins/index.js

import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin';

module.exports = (on, config) => {
  getCompareSnapshotsPlugin(on, config);
....

e2e/cypress/support/commands.ts

import compareSnapshotCommand from 'cypress-visual-regression/dist/command';
compareSnapshotCommand();
....

My VSCode seems to show my imports are pointing correctly to the respective files in node_modules/cypress-visual-regression/dist/....

Any help will be appreciated!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Zaistacommented, Jun 22, 2022

Could you try with this option in tsconfig.json file:

"esModuleInterop": true,

And then use the normal import statement:

import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin';
1reaction
michal-karbaszcommented, Jun 1, 2022

I got exactly the same errors. For now, I silenced the last one by creating /cypress/global.d.ts with declare module 'cypress-visual-regression/dist/plugin';

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: (0 , dayjs_1.default) is not a function - Stack Overflow
It was working on my previous app, but I don't know why do I get this error for my new application? node.js ·...
Read more >
TypeError: (0 , _css.default) is not a function #6346 - GitHub
Prerequisites I am using the correct version of React-Bootstrap for my version of Bootstrap I have searched for duplicate or closed issues I ......
Read more >
(0 , dayjs_1.default) is not a function - You.com - You.com
Angularfixing.com > typeerror-0-dayjs_1-default-is-not-a-function. Solution. dayjs does not export a default entry like that; use import * as dayjs from ...
Read more >
WP 6.1: TypeError: (0 , E.__experimentaluseLayoutClasses) is ...
The Error Occurs in WordPress 6.1 Only DESCRIPTION TypeError: (0 , E.__experimentaluseLayoutClasses) is not a function at Xt (https://website-name.…
Read more >
(0 , import_defineToJSON.default) is not a function - Bugs
When trying to import '@8base/auth' to a Vite+Vue 3 project, the following error is trigger by the import statement. Uncaught TypeError: (0 ......
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