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

[Bug]: Update Jest in @storybook/addon-storyshots-puppeteer for compatibility with latest version of puppeteer #20479

Closed
ahayes91 opened this issue Jan 3, 2023 · 1 comment

Comments

@ahayes91
Copy link
Contributor

ahayes91 commented Jan 3, 2023

Describe the bug

Very similar to puppeteer/puppeteer#9121 - when we update Puppeteer from v18.1.0 to v18.2.1 we get an error in our Storyshot tests like the following:

[2022-12-30T00:20:52.134Z] FAIL Storyshot.test.js
[2022-12-30T00:20:52.134Z]   ● Test suite failed to run
[2022-12-30T00:20:52.134Z] 
[2022-12-30T00:20:52.134Z]     Cannot find module 'puppeteer-core/internal/common/DeviceDescriptors.js' from 'packages/learning-web/node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js'
[2022-12-30T00:20:52.134Z] 
[2022-12-30T00:20:52.134Z]     Require stack:
[2022-12-30T00:20:52.134Z]       node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js
[2022-12-30T00:20:52.134Z]       src/__tests__/Storyshot.test.js
[2022-12-30T00:20:52.134Z] 
[2022-12-30T00:20:52.134Z]       3 | import { imageSnapshot } from '@storybook/addon-storyshots-puppeteer';
[2022-12-30T00:20:52.134Z]       4 | import fetch from 'node-fetch';
[2022-12-30T00:20:52.134Z]     > 5 | import puppeteer from 'puppeteer';
[2022-12-30T00:20:52.134Z]         | ^
[2022-12-30T00:20:52.134Z]       6 |
[2022-12-30T00:20:52.134Z]       7 | process.env.staticStore = '.';
[2022-12-30T00:20:52.134Z]       8 |
[2022-12-30T00:20:52.134Z] 
[2022-12-30T00:20:52.134Z]       at Resolver._throwModNotFoundError (node_modules/jest-runtime/node_modules/jest-resolve/build/resolver.js:425:11)
[2022-12-30T00:20:52.134Z]       at Object.<anonymous> (packages/learning-web/node_modules/puppeteer/src/puppeteer.ts:18:1)
[2022-12-30T00:20:52.134Z]       at Object.<anonymous> (packages/learning-web/src/__tests__/Storyshot.test.js:5:1)
[2022-12-30T00:20:52.134Z]           at runMicrotasks (<anonymous>)
[2022-12-30T00:20:52.134Z] 
[2022-12-30T00:20:52.134Z] Test Suites: 1 failed, 1 total

From looking at puppeteer/puppeteer#9121 and running npm list jest in our repo, we can see that Jest is on a lower version in the latest version of the addon:

├─┬ @storybook/addon-storyshots-puppeteer@6.5.15
│ └─┬ jest-image-snapshot@4.5.1
│   └── jest@27.5.1

If I get a chance I'll create a full repro for this ticket, but wanted to raise this in the meantime anyway in case other folks are seeing the same issue (and hopefully updating Jest is an easy fix).

To Reproduce

No response

System

No response

Additional context

No response

@jonniebigodes
Copy link
Contributor

The Storyshots addon is officially deprecated and will be removed in a future release of Storybook. To help with the transition process, we've created a migration guide for the available options and common use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants