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.

[BUG] Error on first run of "npm run storybook"

See original GitHub issue

[09:10:04] Documentation generated in ./ in 0.473 seconds info @storybook/angular v6.3.12 info info => Loading presets WARN Failed to load preset: “/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js” ERR! Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@angular/compiler-cli/bundles/ngcc/index.js from /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js not supported. ERR! Instead change the require of index.js in /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js to a dynamic import() which is available in all CommonJS modules. ERR! at Object.<anonymous> (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js:70:14) ERR! at interopRequireDefault (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:159:16) ERR! at getContent (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:175:10) ERR! at loadPreset (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:184:20) ERR! at /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:236:18 ERR! at Array.reduce (<anonymous>) ERR! at loadPresets (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:235:18) ERR! at getPresets (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:293:23) ERR! at loadAllPresets (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:318:10) ERR! at buildDevStandalone (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-server/dist/cjs/build-dev.js:101:48) ERR! at async Object.buildDev (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-server/dist/cjs/build-dev.js:154:5) ERR! Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@angular/compiler-cli/bundles/ngcc/index.js from /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js not supported. ERR! Instead change the require of index.js in /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js to a dynamic import() which is available in all CommonJS modules. ERR! at Object.<anonymous> (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/framework-preset-angular-ivy.js:70:14) ERR! at interopRequireDefault (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:159:16) ERR! at getContent (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:175:10) ERR! at loadPreset (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:184:20) ERR! at /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:236:18 ERR! at Array.reduce (<anonymous>) ERR! at loadPresets (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:235:18) ERR! at getPresets (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:293:23) ERR! at loadAllPresets (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-common/dist/cjs/presets.js:318:10) ERR! at buildDevStandalone (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-server/dist/cjs/build-dev.js:101:48) ERR! at async Object.buildDev (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/core-server/dist/cjs/build-dev.js:154:5) { ERR! code: ‘ERR_REQUIRE_ESM’ ERR! } info => Loading 1 config file in “/Users/ppatel/Documents/Projects/selective-storybook/.storybook” info => Loading 9 other files in “/Users/ppatel/Documents/Projects/selective-storybook/.storybook” info => Adding stories defined in “/Users/ppatel/Documents/Projects/selective-storybook/.storybook/main.js” (node:67175) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/ppatel/Documents/Projects/selective-storybook/node_modules/tslib/package.json. Update this package.json to use a subpath pattern like “./*”. (Use node --trace-deprecation ... to show where the warning was created) info => Using prebuilt manager info => Found custom tsconfig.json info => Using implicit CSS loaders info => Loading angular-cli config info => Using angular project “selective-storybook:build” for configuring Storybook ERR! => Could not get angular cli webpack config ERR! TypeError: Cannot read properties of undefined (reading ‘target’) ERR! at /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:145:49 ERR! at step (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:69:23) ERR! at Object.next (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:50:53) ERR! at fulfilled (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:41:58) ERR! TypeError: Cannot read properties of undefined (reading ‘target’) ERR! at /Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:145:49 ERR! at step (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:69:23) ERR! at Object.next (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:50:53) ERR! at fulfilled (/Users/ppatel/Documents/Projects/selective-storybook/node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:41:58)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
dartjavacommented, Nov 16, 2021

Hello! I’ve got the same error, and searching for an answer I’ve found a workaround which works for me.

I’ve run npx sb@next init for a non stable storybook version (at this moment is 6.4.0-rc.2).

Then I fixed the pathing inside the file .storybook/tsconfig.json from "extends": "../false", to "extends": "../tsconfig.json",.

Now if I run npm run storybook my project run correctly without errors.

I’m a really really newbie but I hope this helps.

0reactions
stale[bot]commented, Apr 25, 2022

This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error running storybook - sh: 1: start-storybook: not found
This error is due to the node_modules folder. If you delete that folder and run npm install . it will work. Mostly due...
Read more >
Bug #24612: `npm run storybook` is broken in Katello - Foreman
It works fine in Foreman, but it seems Katello hasn't been following their paradigms. $ npm run storybook > katello@1.0.0 storybook ...
Read more >
Install Storybook
Use the Storybook CLI to install it in a single command. ... on your framework, first, build your app and then check that...
Read more >
Error when running npm run build : r/react - Reddit
Error when running npm run build · Delete package-lock.json (not package.json!) and/or yarn. · Delete node_modules in your project folder. · Remove ...
Read more >
Setup • Chromatic docs
Setup and publish Storybook · Sign up · Install · Run Chromatic · View published Storybook · Get the PR check · Next:...
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