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.

DocsPage customization error in Angular

See original GitHub issue

I’m trying to reproduce the DocsPage customization you guys pulled off in the config.js below, but for Angular: https://github.com/storybookjs/storybook/pull/7680/files#diff-e1df968bb7311b09ca002ef2869df4ee

…but I’m getting:

ERROR in ./.storybook/preview.js 111:11
Module parse failed: Unexpected token (111:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|   docs: function docs(_ref) {
|     var context = _ref.context;
>     return <DocsPage context={context} subtitleSlot={function (_ref2) {
|       var selectedKind = _ref2.selectedKind;
|       return "Subtitle: ".concat(selectedKind);
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/angular/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true ./src/globalStyles.scss main[4]

A straight up docs: DocsPage works fine, but when I try to override it like shown in your code, it explodes. Is this possible with Angular?

At the end of the day, I’m just looking to include custom story-level markdown in the description or subtitle slots. So a tip on another approach would unblock me, but it would be nice to be able to granularly customize like that PR example aimed for.

System: OS: macOS Mojave 10.14.3 CPU: (8) x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz Binaries: Node: 10.9.0 - ~/.nvm/versions/node/v10.9.0/bin/node npm: 6.2.0 - ~/.nvm/versions/node/v10.9.0/bin/npm Browsers: Chrome: 79.0.3945.117 Firefox: 70.0.1 Safari: 12.0.3 npmPackages: @storybook/addon-backgrounds: ^5.3.2 => 5.3.2 @storybook/addon-docs: ^5.3.2 => 5.3.2 @storybook/addon-knobs: ^5.3.2 => 5.3.2 @storybook/addon-storysource: ^5.3.2 => 5.3.2 @storybook/addons: ^5.3.2 => 5.3.2 @storybook/angular: ^5.3.2 => 5.3.2 @storybook/source-loader: ^5.3.2 => 5.3.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dexstercommented, Aug 4, 2021

Was this ever fixed? Still getting this in 6.4

0reactions
stale[bot]commented, May 1, 2020

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DocsPage - Storybook - JS.ORG
If you want to include a custom component to display documentation, you'll need to update your environment to allow React components to be...
Read more >
Angular elements overview
Creating a custom element is simple and straightforward, and automatically connects your component-defined view with change detection and data binding, mapping ...
Read more >
Using Angular in extension on a page that already uses angular
All I need to reproduce the issue is to include angular in my manifest.json as a content_script and this error is thrown. Any...
Read more >
Customizing error reports - Angular - Bugsnag docs
Learn how to modify and send custom diagnostic data to JavaScript error reports. Automatically captured reports include a stacktrace, browser info, ...
Read more >
Debugging "Unknown Provider" In Minified Angular.js
Thankfully Angular has a feature that creates a custom docs page for you based on your error. You can see the URL for...
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