Skip to content

ESM/TypeScript: Cant get new 1.0.x version to work with Jest/Puppeteer/TypeScript or ESM #869

@tmcconechy

Description

@tmcconechy

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/cli version: 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

With ESM Conversion

See the error Cannot find module '#logger' from 'node_modules/@percy/logger/dist/index.js'

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions