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.

getPage seems to fail on the second run

See original GitHub issue

🐛 Bug Report

When i run one test with getPage() it works fine, but if i duplicate that test and run it again inside another it() i get an error.

Im trying to write multiple tests to test different state/data being sent but i can only use one getPage per test-suite

    TypeError: Cannot destructure property 'getInitialProps' of 'AppComponent' as it is undefined.

      at Object.fetchAppData (node_modules/next-page-tester/dist/_app/fetchAppData.js:12:13)
      at Object.fetchRouteData (node_modules/next-page-tester/dist/fetchData/fetchRouteData.js:9:42)
      at Object.getPageInfo (node_modules/next-page-tester/dist/makePageElement.js:24:40)
      at getPage (node_modules/next-page-tester/dist/getPage.js:84:38)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
toomuchdesigncommented, Feb 8, 2021

Hi @jasonwilliams, do your tests differ from the ones this library is tested with? Here is an example of a test file with multiple getPage calls.

If yes would you mind providing a reproducible example?

PS. Are you calling something like jest.resetModules() between tests?

0reactions
toomuchdesigncommented, Feb 9, 2021

Yep @Meemaw, this was actually my issue! 👏 👏👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form::getPage() throws Error when returning null #518 - GitHub
When $form->getPage() is called in onFormInitialized in plugin, an Error is thrown, when page has not yet been initialized.
Read more >
selenium unable to get page after opening it with python
Any page I try to open, a timeout error is returned after awhile: Traceback (most recent call last): File "C:\Users\MunteanuG\AppData\Local\ ...
Read more >
Fixing the 'cannot GET /URL' error on refresh with React ...
The first, set up both client and server side routing. The second, redirect all server requests to /index.html which will download all the...
Read more >
SQL Server diagnostics added to detect unreported I/O ...
In some instances, a page appears to be updated two times but with the same LSN value.
Read more >
[Solved] Two web GET request in code just works one.
If you don't run out of sockets, it should run ok for a day or two. ... if(!getPage(server,serverPort,pageAdd)) Serial.print(F("Fail first ...
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