-
Notifications
You must be signed in to change notification settings - Fork 54
ESM/TypeScript: Cant get new 1.0.x version to work with Jest/Puppeteer/TypeScript or ESM #869
Description
The problem
Not sure if this is a bug or support issue if it is is just let me know and i'll redirect my question to discussions or support.
The problem is i cant get your new 1.0.5 (any 1.0.0) version to work anymore in any configuration using jest/puppetteer.
Seems like all the tooling is not in place on those ends so not sure what to do.
Environment
- Node version: 16.5.0
@percy/cliversion: 1.0.5- Version of Percy SDK you’re using: 1.0.5
- OS version: Mac OS Monterey
- Type of shell command-line [interface]: zsh
Details
Given below details i cant seem to find a way to use the new version. So sort of at a road block and need to revert to 1.0.0-beta.76 which may not be sustainable if you change things. Also wondering if this should be a major version as it requires major project changes in order to use it
Comment on Versioning
Also (this took me a while to figure out...)
Reverting to "@percy/cli": "^1.0.0-beta.76" "@percy/puppeteer": "^2.0.0" works.
- upgrading @percy/puppeteer from 2.0.0 to 2.0.1 -> gives you the new @percy/cli
- upgrading @percy/cli from 1.0.0-beta.76 to 1.0.5 -> requires a lot of changes and the ESM and TS support with Jest is still a bit experimental and hard to get working (havent yet).
So given that shouldn't these be major versions with breaking changes and more details and examples? Cant seem to find an example of using puppetteer in TS or ESM with jest and percy.
Debug logs
● Ids Accordion Percy Tests › should not have visual regressions in new contrast theme (percy)
Cannot find module '#logger' from 'node_modules/@percy/logger/dist/index.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)
Code to reproduce issue
Without ESM Conversion
- clone this repo https://github.com/infor-design/enterprise-wc and go to this branch https://github.com/infor-design/enterprise-wc/pull/new/no-esm-conversion
- uses node 16
npm i- Run command
npx jest -- accordion-percy - Run Command
JEST_PUPPETEER_CONFIG=jest-puppeteer.config.cjs node --experimental-vm-modules node_modules/jest/bin/jest.js -- accordion-percy
With ESM Conversion
- clone this repo https://github.com/infor-design/enterprise-wc and go to this branch https://github.com/infor-design/enterprise-wc/tree/change-jest-to-esm
- uses node 16
npm i- Run Command
JEST_PUPPETEER_CONFIG=jest-puppeteer.config.cjs node --experimental-vm-modules node_modules/jest/bin/jest.js -- accordion-percy
See the error Cannot find module '#logger' from 'node_modules/@percy/logger/dist/index.js'