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.

Breaking changes in @storybook/polymer from 5.1.3 to 5.1.4

See original GitHub issue

Describe the bug Upgrade @storybook/polymer from 5.1.3 to 5.1.4 breaks storybook.

ERROR in [PROJECT_PATH]/node_modules/@storybook/core/dist/server/common/polyfills.js
Module not found: Error: Cannot find module '[PROJECT_PATH]/node_modules/@open-wc/demoing-storybook/node_modules/@storybook/addon-storysource/loader.js![PROJECT_PATH]/node_modules/core-js/features/symbol/index.js'
Require stack:
- [PROJECT_PATH]/node_modules/@storybook/core/dist/server/preview/noop.js
 @ [PROJECT_PATH]/node_modules/@storybook/core/dist/server/common/polyfills.js 7:0-34
 @ multi [PROJECT_PATH]/node_modules/@storybook/core/dist/server/common/polyfills.js [PROJECT_PATH]/node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

and some 4 more similar errors.

To Reproduce Steps to reproduce the behavior:

  1. Update to 5.14
  2. Run start-storybook -s .
  3. See error

Expected behavior Build the storybook project

Screenshots If applicable, add screenshots to help explain your problem.

Code snippets

System:

  • OS: MacOS
  • Device: Macbook Pro 2018
  • Browser: -
  • Framework: Polymer (WebComponents - LitElement)
  • Addons: -
  • Version: 5.1.4

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:20 (17 by maintainers)

github_iconTop GitHub Comments

4reactions
bennypowerscommented, Aug 20, 2019

I was finally able to get 5.1.11 to build, using the following webpack.config.js:

const and = require('crocks/logic/and');
const isString = require('crocks/predicates/isString');
const compose = require('crocks/helpers/compose');
const propOr = require('crocks/helpers/propOr');

const includes = x => xs => xs.includes(x);
const some = p => xs => xs.some(p);

const getUse = propOr(null, 'use');

const isStyleLoader = and(isString, includes('style-loader'));

const usesStyleLoader = compose(some(isStyleLoader), getUse);

const LIT_CSS_REGEXP = /src\/(.*)\.css$/

const options = require('../.babelrc');

const LIT_CSS_RULE = {
  test: LIT_CSS_REGEXP,
  loader: 'lit-css-loader',
}

const transpilePackages = [
  'lit-html',
  'lit-element',
  '@open-wc',
  'crocks'
]

// this is a separate config for only those packages
// the main storybook will use the .babelrc which is needed so storybook itself works in IE
const TRANSPILE_PACKAGES_RULE = {
  test: /\.js$/,
  include: transpilePackages.map(package => new RegExp(`node_modules(\\/|\\\\)(${package})(.*)\\.js$`)) ,
  exclude: [/@babel\/runtime/, /core-js/, /axe-core/, /@storybook/],
  loader: 'babel-loader',
  options: {
    plugins: [
      '@babel/plugin-syntax-dynamic-import',
      '@babel/plugin-proposal-object-rest-spread',
    ],
    presets: [
      [
        '@babel/preset-env',
        {
          useBuiltIns: 'entry',
          corejs: '3',
        },
      ],
    ],
    babelrc: false,
  }
}

const BABEL_LOADER_RULE = {
  test: /\.js$/,
  loader: 'babel-loader',
  exclude: [/@babel\/runtime/, /core-js/, /axe-core/],
  options
}

module.exports = ({ config }) => {
  config.module.rules = [
    ...config.module.rules,
    BABEL_LOADER_RULE,
    LIT_CSS_RULE,
    TRANSPILE_PACKAGES_RULE,
  ];

  config.module.rules
    .find(usesStyleLoader)
    .exclude = LIT_CSS_REGEXP;

  return config;
};
2reactions
ndelangencommented, May 9, 2020

If someone wants that commit be make it into @storybook/polymer, they’d have to open a PR here https://github.com/storybookjs/storybook/tree/master/app/polymer

FYI we’re dropping support for storybook for polymer and focussing on supporting plain web-components instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storybook 5 Migration Guide
This guide takes you through: Upgrading the Storybook package; Dealing with breaking changes; Getting comfortable in the new UI. Step 1: Package ...
Read more >
Upgrading Storybook
Upgrade script​​ This upgrades all of the Storybook packages in your project to the latest stable version, perform confidence checks of your package...
Read more >
Storybook 6 Migration Guide
This guide takes you through: Upgrading the Storybook packages; Dealing with breaking changes; Updating to current best practices. We assume you ...
Read more >
Storybook 5.1
Storybook is the world's most popular UI component explorer, and 5.1 includes: Mobile: Standalone package architecture for React Native; ...
Read more >
@storybook/api NPM | npm.io
Check @storybook/api 6.5.12 package - Last release 6.5.12 with MIT ... viewport, Change display sizes and layouts for responsive components using Storybook ......
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