मैं स्टोरीबुक को 5.0.11 से 5.2.0 में माइग्रेट करना चाहता हूं लेकिन package.json में संस्करण बदलने के बाद मुझे मिला:

ERROR in ./node_modules/@storybook/theming/dist/utils.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/dist'
 @ ./node_modules/@storybook/theming/dist/utils.js 9:0-42
 @ ./node_modules/@storybook/theming/dist/index.js
 @ ./config/.storybook/config.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

ERROR in ./node_modules/@storybook/theming/node_modules/@storybook/client-logger/dist/index.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/node_modules/@storybook/client-logger/dist'
 @ ./node_modules/@storybook/theming/node_modules/@storybook/client-logger/dist/index.js 3:0-42
 @ ./node_modules/@storybook/theming/dist/ensure.js
 @ ./node_modules/@storybook/theming/dist/index.js
 @ ./config/.storybook/config.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

ERROR in ./node_modules/@storybook/theming/dist/index.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.for-each' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/dist'
 @ ./node_modules/@storybook/theming/dist/index.js 3:0-44
 @ ./config/.storybook/config.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

ERROR in ./node_modules/@storybook/theming/dist/convert.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.index-of' in '/home/twaszczyk/workspaces/ui-elements/node_modules/@storybook/theming/dist'
 @ ./node_modules/@storybook/theming/dist/convert.js 5:0-44
 @ ./node_modules/@storybook/theming/dist/index.js
 @ ./config/.storybook/config.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./config/.storybook/config.js (webpack)-hot-middleware/client.js?reload=true

मैं माइग्रेशन गाइड में भी ढूंढ रहा था लेकिन इसे खत्म करने के लिए मुझे क्या करना चाहिए कुछ भी नहीं मिला।

3
Tomasz Waszczyk 18 सितंबर 2019, 12:02

1 उत्तर

सबसे बढ़िया उत्तर

समाधान के नीचे (उम्मीद है कि यह मदद):

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "declarationMap": false
  }
}

package.json में माइग्रेट की गई निर्भरताएं:

"@storybook/addon-actions": "^5.2.0",
"@storybook/addon-centered": "^5.2.0",
"@storybook/addon-info": "^5.2.0",
"@storybook/addon-knobs": "^5.2.0",
"@storybook/addon-storysource": "^5.2.0",
"@storybook/addon-viewport": "^5.2.0",
"@storybook/components": "^5.2.0",
"@storybook/react": "^5.2.0",
"@storybook/source-loader": "^5.2.0",
"@storybook/theming": "^5.2.0",

babel-loader से ts-loader तक जाने के लिए भी इसकी आवश्यकता थी।

1
Tomasz Waszczyk 21 नवम्बर 2019, 10:58