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.

No preview + error only in built app.

See original GitHub issue

Describe the bug When the built app is running, stories are not loading. “No Preview” message is shown.

this error pops up in console:

image

But this happens only when I’m running the build. In dev server there’s no errors.

To Reproduce Steps to reproduce the behavior:

  1. run command npm run build-storybook
  2. run command serve storybook-static (I’m using serve npm package to start a sever)
  3. open the browser
  4. see error

Expected behavior Two stories should be displayed.

Screenshots

image

Code snippets main.js

module.exports = {
  stories: ['../src/stories/**/*.stories.(js|mdx)'],
  addons: [
    '@storybook/addon-docs',
    '@storybook/addon-storysource',
    '@storybook/addon-actions',
    '@storybook/addon-links',
    '@storybook/addon-knobs',
    '@storybook/addon-viewport',
    '@storybook/addon-backgrounds',
    '@storybook/addon-a11y',
    '@storybook/addon-contexts',
    '@storybook/addon-notes/register-panel'
  ],
};

manager.js

import { addons } from '@storybook/addons';

addons.setConfig({
  showRoots: true,
  panelPosition: 'right',
});

preview.js

import { addParameters } from '@storybook/vue';
import Vue from 'vue';
import Vuex from 'vuex';
import 'p1-design-system/CSS Framework/framework.css'

Vue.use(Vuex);

addParameters({
  docs: {
    inlineStories: true,
    iframeHeight: '60px',
  },
});

System:

OS: Windows 10 10.0.16299
CPU: (4) x64 Intel(R) Core(TM) i3-8130U CPU @ 2.20GHz

Binaries: Node: 10.15.0 - C:\Program Files\nodejs\node.EXE npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 41.16299.967.0 npmPackages: @storybook/addon-a11y: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-actions: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-backgrounds: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-centered: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-contexts: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-docs: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-knobs: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-links: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-notes: ^5.3.18 => 5.3.18 @storybook/addon-storyshots: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-storysource: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addon-viewport: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/addons: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/source-loader: 6.0.0-alpha.30 => 6.0.0-alpha.30 @storybook/vue: 6.0.0-alpha.30 => 6.0.0-alpha.30

Additional context I used this as the starter project: https://github.com/storybookjs/storybook/tree/next/examples/vue-kitchen-sink

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
shilmancommented, Apr 27, 2020

@Dulan666 in the past serve storybook-static has been problematic. what happens if you run cd storybook-static && serve or npx http-server storybook-static?

0reactions
DulanHewagecommented, Apr 28, 2020

Since I haven’t got any luck with TypeError: Cannot read property 'id' of undefined error, I re-created my project with a fresh copy of vue-kitchen-sink

now the prod. build is working fine. as @shilman mentioned app doesn’t load on serve server. I had to use http-server

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when previewing on device | Apple Developer Forums
When the Xcode Previews app opens on the device, this is the error message in Xcode: RemoteHumanReadableError: Failed to update preview.
Read more >
"Preview not available" error when you use a print application ...
Fixes an issue in which the "Preview not available" message is displayed when you try to print by using a print application. This...
Read more >
New features in Android Studio Preview
This page lists the new features introduced in Android Studio preview releases. The preview builds provide early access to the latest features and ......
Read more >
SwiftUI Preview - Failed to Build Scheme, No such module ...
1. This was the solution for me. I have 3 different schemas and build configurations, and the SwiftUI preview stopped working once added....
Read more >
Preview not working on Mac - MacPaw
If macOS is up to date, the next step would normally be to reinstall the misbehaving application. However, Preview is a system application...
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