bakerface / react-native-svg-web

A web replacement for react-native-svg
44 stars 11 forks source link

Doesn't work with Storybook anymore, since v1.0.8 #14

Closed efoken closed 4 years ago

efoken commented 4 years ago

I get the following error when using with Storybook, since the latest release:

ERROR in ./node_modules/react-native-svg-web/index.js 31:23
Module parse failed: Unexpected token (31:23)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| function createElement(name, type) {
|   return class CreateElement extends React.Component {
>     static displayName = name;
|     static propTypes = {
|       children: PropTypes.node,
 @ ./packages/icons/src/components/MessageTwoTone.tsx 1:315-342
 @ ./packages/icons/src/index.ts
 @ ./packages/icons/dist/icons.esm.js
 @ ./packages/core/src/components/ActionButton/ActionButton.stories.tsx
 @ ./packages sync ^\.\/(?:(?:(?!\.)(?:(?:(?!(?:|\/)\.).)*?)\/)?(?!\.)(?=.)[^/]*?\.stories\.tsx\/?)$
 @ ./.storybook/generated-entry.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/preview.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true

I use Storybook with React Native Web and have the following snippet in my Webpack config:

alias: {
  'react-native': 'react-native-web',
  'react-native-svg': 'react-native-svg-web',
},

Seams that Storybook doesn't transpile packages in node_modules – so class properties with static cannot work...

bakerface commented 4 years ago

@efoken thank you for reporting the issue, I am releasing a new version without the static class properties.