Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-docs: DOCS_MODE undefined in ui_dll #7024

Closed
2 tasks
shilman opened this issue Jun 11, 2019 · 4 comments
Closed
2 tasks

Addon-docs: DOCS_MODE undefined in ui_dll #7024

shilman opened this issue Jun 11, 2019 · 4 comments
Assignees
Milestone

Comments

@shilman
Copy link
Member

shilman commented Jun 11, 2019

As part of addon-docs we're using a webpack-defined variable called DOCS_MODE to communicate from the CLI (e.g. yarn storybook --docs) to the manager whether or not to display the "docs mode UI" (canvas hidden, etc.)

This is working successfully in the examples directories that use the --no-dll flag. However, it is not working in the standard DLL directories such as examples/svelte-kitchen-sink. The UI does not render and there is an error in the JS console.

This is the stack trace running in development v5.2.0-alpha.23:

Uncaught ReferenceError: DOCS_MODE is not defined
    at Object.<anonymous> (storybook_ui_dll.js:2)
    at Object.SbT1 (storybook_ui_dll.js:2)
    at n (storybook_ui_dll.js:2)
    at Object.../../lib/ui/dist/index.js (main.5174b68e0e7dfc934e4e.bundle.js:8689)
    at __webpack_require__ (runtime~main.e27e72d77edfc378d751.bundle.js:80)
    at Object.../../lib/core/dist/client/manager/index.js (main.5174b68e0e7dfc934e4e.bundle.js:8523)
    at __webpack_require__ (runtime~main.e27e72d77edfc378d751.bundle.js:80)
    at Object.0 (main.5174b68e0e7dfc934e4e.bundle.js:10369)
    at __webpack_require__ (runtime~main.e27e72d77edfc378d751.bundle.js:80)
    at checkDeferredModules (runtime~main.e27e72d77edfc378d751.bundle.js:46)

Proposal

Communicate variables via globals in the page template rather than through webpack define plugin.

  • DOCS_MODE
  • PREVIEW_URL
@shilman
Copy link
Member Author

shilman commented Jun 11, 2019

Also, possibly unrelated --docs is no longer working in v5.2.0-alpha.23 in a standalone project. There is no error, but running with --docs seemingly has no effect (the canvas still shows, etc.). This might be due to a bad merge of the next branch into release/docs-technical-preview.

@ndelangen
Copy link
Member

I'm on it

@shilman
Copy link
Member Author

shilman commented Jul 31, 2019

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.19 containing PR #7622 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman
Copy link
Member Author

shilman commented Aug 23, 2019

Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.40 containing PR #7647 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants