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

Getting environment.getStore(...).getEpoch is not a function #5

Open
LionC opened this issue Oct 20, 2021 · 2 comments
Open

Getting environment.getStore(...).getEpoch is not a function #5

LionC opened this issue Oct 20, 2021 · 2 comments

Comments

@LionC
Copy link

LionC commented Oct 20, 2021

I set up a story following the guide in the README. It typechecks correctly and storybook builds and runs, but when trying to render the actual story, I get:

TypeError: environment.getStore(...).getEpoch is not a function
    at FragmentResourceImpl.readWithIdentifier (http://localhost:6006/vendors~main.iframe.bundle.js:77442:45)
    at useFragmentNode (http://localhost:6006/vendors~main.iframe.bundle.js:79413:41)
    at useLazyLoadQueryNode (http://localhost:6006/vendors~main.iframe.bundle.js:79776:26)
    at useLazyLoadQuery (http://localhost:6006/vendors~main.iframe.bundle.js:79645:14)
    at QueryWrapper (http://localhost:6006/main.iframe.bundle.js:2011:95)
    at renderWithHooks (http://localhost:6006/vendors~main.iframe.bundle.js:61843:18)
    at mountIndeterminateComponent (http://localhost:6006/vendors~main.iframe.bundle.js:64669:13)
    at beginWork (http://localhost:6006/vendors~main.iframe.bundle.js:65907:16)
    at HTMLUnknownElement.callCallback (http://localhost:6006/vendors~main.iframe.bundle.js:50803:14)
    at Object.invokeGuardedCallbackDev (http://localhost:6006/vendors~main.iframe.bundle.js:50852:16)

(QueryWrapper being my component).

Investigating this for some seconds, I suspected that this is because this package is one major behind the current version of relay-test-utils, which introduced the concept of epochs. I suspect that upgrading would fix it, although I do not know which other breaking changes were introduced.

Sadly, this makes the package not usable in a current version setup.

@richardguerre
Copy link
Owner

@LionC thanks for pointing this out. I actually copied the code directly from relay-test-utils@11.0.2 directly and made some minor changes on top of it.

I could potentially try and add the missing lines, but I don't have that much time right now to do it myself, but if you are willing to do it, feel free to send a PR over, or use patch-package.

@joeried
Copy link

joeried commented Feb 7, 2022

I had the same problem. The hints in this issue gave me the idea to use the resolutions feature of yarn to resolve "relay-test-utils" to the correct relay version.

I use relay 13.0.2 and therefore the entry in the package.json looks like this:

 "resolutions": {
    "relay-test-utils":"^13.0.2"
  }

With this, the package seems to work again. However, I have not yet been able to do more extensive testing.

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

No branches or pull requests

3 participants