question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storyshots is broken with React 16

See original GitHub issue

Running Snapshots with React 16 fails due to Cannot read property 'ReactCurrentOwner' of undefined

I created a simple repo here for this https://github.com/eddiemonge/snapshots-broken

Here’s the full output

 FAIL  ./snapshots.js
  ● Test suite failed to run

    TypeError: Cannot read property 'ReactCurrentOwner' of undefined

      at node_modules/react-test-renderer/cjs/react-test-renderer.development.js:621:36
      at Object.<anonymous> (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8254:3)
      at Object.<anonymous> (node_modules/react-test-renderer/index.js:6:20)
      at Object.<anonymous> (node_modules/@storybook/addon-storyshots/dist/test-bodies.js:10:26)
      at Object.<anonymous> (node_modules/@storybook/addon-storyshots/dist/index.js:12:19)
      at Object.<anonymous> (snapshots.js:1:113)
          at Generator.next (<anonymous>)
          at Promise (<anonymous>)
      at handle (node_modules/worker-farm/lib/child/index.js:44:8)
      at process.<anonymous> (node_modules/worker-farm/lib/child/index.js:51:3)
      at emitTwo (events.js:125:13)
      at process.emit (events.js:213:7)
      at emit (internal/child_process.js:774:12)
      at _combinedTickCallback (internal/process/next_tick.js:141:11)
      at process._tickCallback (internal/process/next_tick.js:180:9)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
eddiemongecommented, Jan 8, 2018

although I fixed it by passing an empty config object to multi instead of no arguments:

initStoryshots({
  test: multiSnapshotWithOptions({})
})
2reactions
rsimsekcommented, Nov 24, 2017

I have react@16 and react-test-renderer@16 and still fails.

 ● Test suite failed to run

    TypeError: Cannot read property 'ReactCurrentOwner' of undefined

      at node_modules/react-test-renderer/cjs/react-test-renderer.development.js:77:39
      at Object.<anonymous> (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7676:5)
      at Object.<anonymous> (node_modules/react-test-renderer/index.js:6:20)
      at Object.<anonymous> (node_modules/@storybook/addon-storyshots/dist/test-bodies.js:10:26)
      at Object.<anonymous> (node_modules/@storybook/addon-storyshots/dist/index.js:12:19)
      at Object.<anonymous> (.storybook/storyshots.test.js:1:126)
Read more comments on GitHub >

github_iconTop Results From Across the Web

src/Storyshots.test.ts - Stack Overflow
I have no common folder. This is an example of one of my stories: Basic.stories.tsx. import React from ...
Read more >
Storyshots is not working with React 18 #17985 - Issuehunt
Describe the bug. "@storybook/addon-storyshots": "^6.4.22" is not working with React 18 Since version 6.4.22 Storybook works fine with React 18, ...
Read more >
Frequently Asked Questions - Storybook - JS.ORG
Is snapshot testing with Storyshots supported for Vue 3? Why are my MDX stories not working in IE11? Why aren't my code blocks...
Read more >
@storybook/addon-storyshots - npm
Javascript Testing with Jest - Egghead. paid content. Note: If you use React 16, you'll need to follow these additional instructions. Note: Make ......
Read more >
@storybook/addon-storyshots | Yarn - Package Manager
6.5.14 (December 2, 2022). Bug Fixes. Angular: Fix "webpack_require.nmd is not a function issue" in Angular 15 #20043; CLI/React native: Fix addons template ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found