Skip to content
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

esModuleInterop / typescript causes issues #109

Open
csi-lk opened this issue May 19, 2021 · 2 comments
Open

esModuleInterop / typescript causes issues #109

csi-lk opened this issue May 19, 2021 · 2 comments
Labels
🐛 bug Something isn't working

Comments

@csi-lk
Copy link
Contributor

csi-lk commented May 19, 2021

When setting the compilerOption esModuleInterop to true

Issue

Example test:

import percySnapshot from '@percy/testcafe';
fixture('Session').page('http://localhost:8080');

test('Session: Visual Regression', async (target) => {
   await percySnapshot(target, 'Session: Welcome');
});

(ignore type error with percySnapshot, covered in #108)

Gives me an error of:

   1) TypeError: testcafe_1.default is not a function

      Browser: Chrome 90.0.4430.212 / macOS 10.15.7

          8 |
          9 |import percySnapshot from '@percy/testcafe';
         10 |fixture('Session').page('http://localhost:8080');
         11 |
         12 |test('Session: Visual Regression', async target => {
       > 13 |  await percySnapshot(target, 'Session: Welcome');
         14 |});
         15 |

Workaround

import * as percySnapshot from '@percy/testcafe';

fixture('Session').page('http://localhost:8080');

test('Session: Visual Regression', async target => {
  await (percySnapshot as any)(target, 'Session: Welcome');
});

(replace the any with the type when fixed)

Futher Reading

DevExpress/testcafe#3983

https://stackoverflow.com/questions/56238356/understanding-esmoduleinterop-in-tsconfig-file

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 3, 2021
@Robdel12 Robdel12 added 🍞 stale Closed due to inactivity and removed Stale labels Aug 3, 2021
@csi-lk
Copy link
Contributor Author

csi-lk commented Aug 4, 2021

@Robdel12 Still hasn't been actioned and is an active issue
Only changes I can see in the repo seem to be dependency or github actions related :)

@github-actions github-actions bot removed the 🍞 stale Closed due to inactivity label Aug 10, 2021
@Robdel12 Robdel12 added the 🐛 bug Something isn't working label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants