Describe the bug
After do the installation explain here https://storybook.js.org/docs/guides/guide-angular/
i tried to run my storybook but i get an error:
ERR! TypeError: Cannot destructure property options of 'undefined' or 'null'.
ERR! at getAngularCliWebpackConfigOptions (/Users/charlypy/qima-platform/front/node_modules/@storybook/angular/dist/server/angular-cli_config.js:70:9)
ERR! at Object.webpackFinal (/Users/charlypy/qima-platform/front/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:14:92)
ERR! at /Users/charlypy/qima-platform/front/node_modules/@storybook/core/dist/server/presets.js:74:72
ERR! at processTicksAndRejections (internal/process/task_queues.js:89:5)
ERR! TypeError: Cannot destructure property options of 'undefined' or 'null'.
ERR! at getAngularCliWebpackConfigOptions (/Users/charlypy/qima-platform/front/node_modules/@storybook/angular/dist/server/angular-cli_config.js:70:9)
ERR! at Object.webpackFinal (/Users/charlypy/qima-platform/front/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:14:92)
ERR! at /Users/charlypy/qima-platform/front/node_modules/@storybook/core/dist/server/presets.js:74:72
ERR! at processTicksAndRejections (internal/process/task_queues.js:89:5) {
ERR! stack: "TypeError: Cannot destructure property options of 'undefined' or " +
ERR! "'null'.\n at getAngularCliWebpackConfigOptions " +
ERR! '(/Users/charlypy/qima-platform/front/node_modules/@storybook/angular/dist/server/angular-cli_config.js:70:9)\n' +
ERR! ' at Object.webpackFinal ' +
ERR! '(/Users/charlypy/qima-platform/front/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:14:92)\n' +
ERR! ' at ' +
ERR! '/Users/charlypy/qima-platform/front/node_modules/@storybook/core/dist/server/presets.js:74:72\n' +
ERR! ' at processTicksAndRejections ' +
ERR! '(internal/process/task_queues.js:89:5)'
ERR! }

The project has been generated with Jhypster. I have npm v : 6.9.0, node : 12.1.0 and angular 7.2.2
I'm getting a very similar issue when I run npx -p @storybook/cli sb init --type angular in my Ionic Angular application.
TypeError: Cannot read property 'undefined' of undefined
at getAngularAppTsConfigPath (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/lib/helpers.js:78:24)
at getAngularAppTsConfigPath (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/lib/helpers.js:87:24)
at editAngularAppTsConfig (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/generators/ANGULAR/index.js:47:24)
at editAngularAppTsConfig (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/generators/ANGULAR/index.js:66:3)
at call (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.tryCatch [as _invoke] (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/node_modules/regenerator-runtime/runtime.js:288:22)
at Generator._invoke [as next] (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/node_modules/regenerator-runtime/runtime.js:114:21)
at asyncGeneratorStep (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/generators/ANGULAR/index.js:50:103)
at _next (/Users/smilinknight/.npm/_npx/5404/lib/node_modules/@storybook/cli/generators/ANGULAR/index.js:52:194)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
Different symptoms but I expect this is a dupe of #6804
i try on other project and it's works. Maybe the problem come from the tree of the project and the fact that it hasn't been generated by the CLI?
In our case (@CharlesPoquet and I), we are able to launch Storybook when adding build options in our angular.json. This error message could not be more explicit ?
Wait @CharlesPoquet and @fishonweb you were able to fix it? Could you please show me?
@arjunkalburgi we fix it for our project. The undefined was build from angular.json, so we add build and options in project in our angular.json like this
"projects": {
"app-front": {
"root": "",
"sourceRoot": "src/main/webapp",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "build",
"index": "src/index.html",
"main": "src/main/webapp/app/app.main.ts",
"polyfills": "src/main/webapp/app/polyfills.ts",
"tsConfig": "tsconfig.json",
"assets": ["src/main/webapp/content"],
"styles": ["src/main/webapp/content/global.css"],
"scripts": []
}
}
}
}
},
Hope it will help you
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!
Most helpful comment
@arjunkalburgi we fix it for our project. The
undefinedwasbuildfromangular.json, so we add build and options in project in ourangular.jsonlike thisHope it will help you