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)
This error seems to happen because storybook calls
window.history.replaceState()while insideabout:blank. This is because JSDOM sets the window location toabout:blankby default. To fix this, I added the url argument to the JSDOM constructor here:I also changed the following line here:
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 testevery time.Some guidance on how to setup a loki dev environment would be really useful.
Cheers!
@storybook/react@3.1.7withloki@0.9.1works for us.Any update on this issue? I am also experiencing the same issue when I try to run
loki update@nuc I found out the errors comes from this line https://github.com/oblador/loki/blob/3306f812b3f9984476f35bbad30e83506bd89948/src/targets/chrome/fetch-storybook-worker.js#L26 not sure 🤔 what is going on
How did you get to this line? https://github.com/storybooks/storybook/blob/850e48d39e6367c9dd077df21c8cbea11c840c1b/lib/core/src/client/preview/syncUrlWithStore.js#L24
I have the same issue with various combinations of react, storybook and loki. For example,