Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

运行storybook报错了 #49

Closed
zhuzhuaicoding opened this issue Jul 15, 2020 · 6 comments
Closed

运行storybook报错了 #49

zhuzhuaicoding opened this issue Jul 15, 2020 · 6 comments

Comments

@zhuzhuaicoding
Copy link

zhuzhuaicoding commented Jul 15, 2020

ERROR in ./stories/pivot/pivot-utils.stories.tsx
Module not found: Error: Can't resolve 'core-js/modules/web.dom-collections.iterator' in 'E:\code\ali-react-table\stories\pivot'
@ ./stories/pivot/pivot-utils.stories.tsx 15:0-54
@ ./stories/pivot sync nonrecursive (?:pivot-utils.stories.tsx)$
@ ./.storybook/generated-stories-entry.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./.storybook/generated-stories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false

ERROR in ./stories/pivot/MinimumPivotTableDesigner.tsx
Module not found: Error: Can't resolve 'core-js/modules/web.dom-collections.iterator' in 'E:\code\ali-react-table\stories\pivot'
@ ./stories/pivot/MinimumPivotTableDesigner.tsx 11:0-54
@ ./stories/pivot/pivot-utils.stories.tsx
@ ./stories/pivot sync nonrecursive (?:pivot-utils.stories.tsx)$
@ ./.storybook/generated-stories-entry.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./.storybook/generated-stories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false

@zhuzhuaicoding zhuzhuaicoding changed the title 111 运行storybook报错了 Jul 15, 2020
@feichao93
Copy link
Collaborator

feichao93 commented Jul 15, 2020

看起来像是缺少 core-js 这个库 我看看我本地清空 node_modules 能不能复现这个情况
似乎和 zloirock/core-js#500 这个有关系

@zhuzhuaicoding
Copy link
Author

看起来像是缺少 core-js 这个库 我看看我本地清空 node_modules 能不能复现这个情况
似乎和 zloirock/core-js#500 这个有关系

我重新拉你的代码,重新npm install后还是不行:(

@feichao93
Copy link
Collaborator

feichao93 commented Jul 15, 2020

@earlymeme yarn add --dev core-js@3 试一下呢? 手动安装 core-js 之后然后跑一下storybook 试一下

@zhuzhuaicoding
Copy link
Author

@shinima 又报这个了。。。

ERROR in ./src/biz/CustomColumnsDialog.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: E:\code\ali-react-table\src\biz\CustomColumnsDialog.tsx: Unexpected token (231:108)

  229 |     if (typeof STORYBOOK_REACT_CLASSES !== "undefined")
  230 |         // @ts-ignore
> 231 |         STORYBOOK_REACT_CLASSES["src/biz/CustomColumnsDialog.tsx#default.makeStyledDrawer"] = { docgenInfo: , default: .makeStyledDrawer.__docgenInfo, name: "default.makeStyledDrawer", path: "src/biz/CustomColumnsDialog.tsx#default.makeStyledDrawer" };
      |                                                                                                             ^
  232 | }
  233 | catch (__react_docgen_typescript_loader_error) { }
  234 | try {
    at Object._raise (E:\code\ali-react-table\node_modules\@babel\parser\src\parser\error.js:60:45)
    at Object.raiseWithData (E:\code\ali-react-table\node_modules\@babel\parser\src\parser\error.js:55:17)
    at Object.raise (E:\code\ali-react-table\node_modules\@babel\parser\src\parser\error.js:39:17)
    at Object.unexpected (E:\code\ali-react-table\node_modules\@babel\parser\src\parser\util.js:152:16)

@feichao93
Copy link
Collaborator

@earlymeme 拉取一下最新代码,checkout enhance-doc 分支,这个分支我本地是 ok 的

@zhuzhuaicoding
Copy link
Author

可以了

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants