Closed Murreey closed 3 months ago
i ran into the same issue with @chromatic-com/cypress
while following the instructions here: https://www.chromatic.com/docs/cypress/. had to convert cypress.config.cjs
to cmj module
Playwright doesn't seem to work the same way as @hustlelikeaboss suggested cypress does.
I ended up moving all my e2e tests into a separate pnpm workspace, and removed type: module
from my package.json.
Hey everybody, this should be fixed in version 0.6.4
. Please give it another try and let us know if you continue to have problems.
Describe the bug When running playwright with
chromatic-playwright
installed in a ES module project, I'm seeing a dynamic require error:That's running in a relatively small reproduction repo with just one test in it, and with
"type": "module"
in the package.json. If I take that type out, it works great and runs the test and creates the archive.This is with the latest version of chromatic-playwright (0.4.0), have tried in a couple different Node/npm versions too just in case (16, 18 & 20) and get the same result.
To Reproduce Install
chromatic-playwright
in a project with"type": "module"
in the package.json, set it up with Playwright as usual, and try to runplaywright test
. I think that's all it takes, I'm seeing it happen in a minimal repo with no code and no other dependencies than chromatic and storybook etc from the install guide.Expected behavior The test runs and the snapshots are taken, same as without
"type": "module"
.Thanks in advance!