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.

when running storybook with npm Ref does not seem to resolve, no output in shell console.

See original GitHub issue

Browser - Firefox Developer, OS Mac Mojave

I’m trying to use the storybook composability functionality in the latest release , I am on storybook/react v6.0.18 - both the storybook that is referencing and the referenced storybook are the same version.

Both storybooks run with npm.

I have two projects - one running on localhost:6006 the other at localhost:6007.

The localhost:6006 is trying to refer to localhost:6007 this is my make.js for localhost:6006

module.exports = {
  "stories": [
    "../stories/**/*.stories.mdx",
    "../stories/**/*.stories.@(js|jsx|ts|tsx)"
  ],
  refs: {
     astronomisk: { 
       title: "Astronomisk Selskab", 
       url: "http://localhost:6007"
     }
    },
  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    {
      name: '@storybook/addon-docs',
      options: {
        configureJSX: true,
      },
    },
  ]
}

The storybook running on localhost:6007 looks fine by itself. But in localhost:6006 when I look at it the left panel where the ref should be shows the title “astronomisk selskab” is present , and 5 placeholders for components to load (gray boxes, animated to imply that they are loading)

The following error is being thrown clientside

Uncaught DOMException: Permission denied to access property “document” on cross-origin object DocumentFormatting.js:154

there is no output in either shell console, so it seems completely a clientside issue.

If I run with Yarn I do not have this issue.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rmknechtcommented, Apr 19, 2022

Double checked with @IanVS recommendation and still see the parent storybook “hanging.” The referenced storybooks load normally when opened directly.

I’m building ~7 storybooks from within a mono-repo, and referencing them from a parent storybook that doesn’t contain any stories itself. Each storybook is served from the same host, statically. Storybooks include addons such as a11y, knobs, links, and actions.

Following up to my previous comment as I’ve resolved the my issue:

1reaction
apete343commented, Jan 4, 2021

hrm, i made a simple test here: https://github.com/apete343/storybook-ref-test

And the refs to localhost work as expected. So not sure what my issue is in the real life scenario yet.

I notice in the test case there are no CORS errors in the console, but in the real life case, there are, just as in the screenshot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@storybook/addon-console - npm
To associate console messages with a specific components/stories. You can see which story emits which message. To output some data into Action ...
Read more >
Shell scripting with Node.js - Exploring JS
If we run node without any arguments, the Node.js REPL does not use strict mode: node. This is what using the Node.js REPL...
Read more >
10 best practices to containerize Node.js web applications ...
Are you looking for best practices on how to build Node.js Docker images for your web applications? Then you've come to the right...
Read more >
Install Storybook
Install the required dependencies. · Setup the necessary scripts to run and build Storybook. · Add the default Storybook configuration. · Add some ......
Read more >
@nrwl/workspace:run-commands | Nx
@nrwl/workspace:run-commands. Run any custom commands with Nx. Options can be configured in project.json when defining the executor, or when invoking it.
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