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.

Setting Vue props via a variable in the story file

See original GitHub issue

Describe the bug Prior to version 6.2.9 the following Story worked:

const org = { name: 'example-org' };

export const Default = () => ({
  components: { Projects },
  store: getClonedStore(),
  props: {
    org: { default: org },
  },
  provide: { user, org, group, requirements },
  template: `<Projects :org="org" />`,
});

Now there’s an error saying org is null.

If I change it to this it works again:

const org = { name: 'example-org' };

export const Default = () => ({
  components: { Projects },
  store: getClonedStore(),
  data() {
    return {
      org,
    };
  },
  provide: { user, org, group, requirements },
  template: `<Projects :org="org" />`,
});

There appears to be some form of regression in the latest version. We were previously on 6.1.21.

We plan to move to the new format, but have hundreds of stories that need reworking and want to do this gradually.

Does anyone have any idea how we can fix this?

System

Environment Info:

  System:
    OS: macOS 11.3
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  Binaries:
    Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.14.11 - ~/Code/snyk/registry/frontend/node_modules/.bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Firefox: 82.0.2
    Safari: 14.1
  npmPackages:
    @storybook/addon-a11y: ^6.2.9 => 6.2.9
    @storybook/addon-actions: ^6.2.9 => 6.2.9
    @storybook/addon-backgrounds: ^6.2.9 => 6.2.9
    @storybook/addon-docs: ^6.2.9 => 6.2.9
    @storybook/addon-queryparams: ^6.2.9 => 6.2.9
    @storybook/addon-storysource: ^6.2.9 => 6.2.9
    @storybook/preset-typescript: ^3.0.0 => 3.0.0
    @storybook/source-loader: ^6.2.9 => 6.2.9
    @storybook/vue: ^6.2.9 => 6.2.9

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pockacommented, May 29, 2021

@shilman Did npx sb@next upgrade --prerelease (installed v6.3.0-beta.4) on the repro repo and it works fine!

Screen Shot 2021-05-29 at 19 46 40 Screen Shot 2021-05-29 at 19 46 58
0reactions
shilmancommented, May 29, 2021

Awesome. thanks so much! 🙏 closing this for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing Props to Route Components | Vue Router
When props is set to true , the route.params will be set as the component props. Named views #. For routes with named...
Read more >
Passing Data via Props in Vue.Js - Yahya Gok - Medium
Props are how you pass data from one component to another, as parameters. In Vue, props (or properties), are the way that we...
Read more >
In vue.js component, how to use props in css? - Stack Overflow
Show activity on this post. You actually can! You should define the CSS variables in a Computed Property, then call the computed property...
Read more >
5 Easy Ways To Pass Info To Vue Components! - YouTube
Vue.js is really easy to pass information to components. There is props, inject/provide, Vuex and more! In this video I discuss the various ......
Read more >
How to Use Props in Vue.js - freeCodeCamp
We use props to pass information/data from a parent component to child components. In this article, I will explain everything you need to ......
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