Storybook: Error when following the guide for setting up storybook with Angular

Created on 18 Oct 2019  路  4Comments  路  Source: storybookjs/storybook

Getting error _SyntaxError: Unexpected token ] in JSON at position_ 195 when running _run storybook_

Steps to reproduce

I tried to follow the steps described here: https://storybook.js.org/docs/guides/guide-angular/

When running _run storybook_ I get SyntaxError: Unexpected token ] in JSON at position 195

Version of Storybook

"@storybook/addon-actions": "^5.2.4",
"@storybook/addon-links": "^5.2.4",
"@storybook/addon-notes": "^5.2.4",
"@storybook/addons": "^5.2.4",
"@storybook/angular": "^5.2.4",

Console error output

ERR! SyntaxError: Unexpected token ] in JSON at position 195
ERR!     at JSON.parse (<anonymous>)
ERR!     at getTsConfigOptions (/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/angular-cli_config.js:32:25)
ERR!     at Object.getAngularCliWebpackConfigOptions (/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/angular-cli_config.js:57:20)
ERR!     at Object.webpackFinal (/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:7:56)
ERR!     at /Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/core/dist/server/presets.js:82:72
ERR!     at processTicksAndRejections (internal/process/task_queues.js:89:5)
ERR!  SyntaxError: Unexpected token ] in JSON at position 195
ERR!     at JSON.parse (<anonymous>)
ERR!     at getTsConfigOptions (/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/angular-cli_config.js:32:25)
ERR!     at Object.getAngularCliWebpackConfigOptions (/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/angular-cli_config.js:57:20)
ERR!     at Object.webpackFinal (/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:7:56)
ERR!     at /Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/core/dist/server/presets.js:82:72
ERR!     at processTicksAndRejections (internal/process/task_queues.js:89:5) {
ERR!   stack: 'SyntaxError: Unexpected token ] in JSON at position 195\n    at ' +
ERR!     'JSON.parse (<anonymous>)\n    at getTsConfigOptions ' +
ERR!     '(/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/angular-cli_config.js:32:25)\n' +
ERR!     '    at Object.getAngularCliWebpackConfigOptions ' +
ERR!     '(/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/angular-cli_config.js:57:20)\n' +
ERR!     '    at Object.webpackFinal ' +
ERR!     '(/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:7:56)\n' +
ERR!     '    at ' +
ERR!     '/Users/joelsjostrom/sr/seating-project/seating-client/node_modules/@storybook/core/dist/server/presets.js:82:72\n' +
ERR!     '    at processTicksAndRejections (internal/process/task_queues.js:89:5)'
ERR! }
angular documentation help wanted inactive

Most helpful comment

@beelio I had a similar issue and was able to fix it by checking the angular.json file. It contained a wrong , (comma).

All 4 comments

@beelio I had a similar issue and was able to fix it by checking the angular.json file. It contained a wrong , (comma).

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!

Found the culprit (note the extra comma before ] ) -
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dependencies[bot] picture dependencies[bot]  路  142Comments

enagy27 picture enagy27  路  69Comments

Gongreg picture Gongreg  路  58Comments

moimikey picture moimikey  路  67Comments

hckhanh picture hckhanh  路  69Comments