loki: Could not parse url argument "?"

I’m getting this in my own app as well as when I run the example app.

loki update v0.7.0
 ❯ Chrome (docker)
   ✔ Start
   ✖ Fetch list of stories
     → Could not parse url argument "?" to pushState against base URL "about:blank".
     Test chrome.laptop
     Stop
Could not parse url argument "?" to pushState against base URL "about:blank".
SecurityError: Could not parse url argument "?" to pushState against base URL "about:blank".
    at HistoryImpl._sharedPushAndReplaceState (/Users/athomson/sandbox/nova/luna/node_modules/jsdom/lib/jsdom/living/window/History-impl.js:73:15)
    at HistoryImpl.pushState (/Users/athomson/sandbox/nova/luna/node_modules/jsdom/lib/jsdom/living/window/History-impl.js:54:10)
    at History.pushState (/Users/athomson/sandbox/nova/luna/node_modules/jsdom/lib/jsdom/living/generated/History.js:89:21)
    at evalmachine.<anonymous>:65329:20
    at Object.dispatch (evalmachine.<anonymous>:50529:7)
    at ConfigApi._renderError (evalmachine.<anonymous>:63464:24)
    at render (evalmachine.<anonymous>:63483:19)
    at ConfigApi.configure (evalmachine.<anonymous>:63498:9)
    at Object.<anonymous> (evalmachine.<anonymous>:57457:22)
    at Object.<anonymous> (evalmachine.<anonymous>:57458:30)

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 9
  • Comments: 32 (12 by maintainers)

Commits related to this issue

Most upvoted comments

This error seems to happen because storybook calls window.history.replaceState() while inside about:blank. This is because JSDOM sets the window location to about:blank by default. To fix this, I added the url argument to the JSDOM constructor here:

function getBrowserGlobals(html, url) {
    const dom = new JSDOM(html, { url });

I also changed the following line here:

    const browser = getBrowserGlobals(html, baseUrl);

This lets me get past this error. However, I then end up with “No stories were found.” as mentioned by others above.

Using the latest versions of Storybook (3.4.0-x) still results in the Could not parse url argument "?" to replaceState against base URL "about:blank". error.

It seems like Loki just can’t open the Storybook URL somehow. Even adding the right URL hardcoded to the source won’t resolve it though. Any thoughts @oblador?

@oblador I’d happily spend some time to get loki up to speed with the latest versions of storybook.

I experimented a bit but I couldn’t figure out how to test out my changes, without having to run loki test every time.

Some guidance on how to setup a loki dev environment would be really useful.

Cheers!

@storybook/react@3.1.7 with loki@0.9.1 works for us.

Any update on this issue? I am also experiencing the same issue when I try to run loki update

I have the same issue with various combinations of react, storybook and loki. For example,

"@storybook/react": "^3.2.17",
"loki": "^0.8.0",
"react": "^15.6.0",