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
faulty script tag support in story templates in v6.1.x #13270
Comments
@kuschti That PR is for |
@shilman we have a special setup with mainly HTML components and a few single components with Vue.js. |
Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.8 containing PR #13271 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Hey I still have issues with the script templates. I have a setup with script templates and I updated to 6.2.9 to use this fix. Unfortunatly it is not behaving as expected or at least what not how I expected it would. With your Changes the simulateDOMContentLoaded is never called so the templates get ignored as expected but the page is not loaded correctly. Is that the expected behavior ? Should I dispatch my own DOMContentLoaded Event to proceed ? Or is it intentional that the page should be in this limbo state ? |
@kuschti can you give a hand with the above? ☝️ |
Describe the bug
With v6.1 there is a support for script tags in story template by PR #12089.
Now, all script tags will be taken, modified and appended at the end of body as a
<script type="text/javascript">
.We have a script tag in the template with options for a vue component, marked as
<script type="text/template">
.And this script is now gone and not working anymore when the story is rendered.
To Reproduce
Steps to reproduce the behavior:
type="text/template"
type="text/javascript"
script tag at the end of the bodyExpected behavior
Only script tags with types from the list in the PR code should taken, all others should be ignored
Code snippets
Example template code that don't work anymore:
How to fix this Problem:
simulate.pageload.js
line 91
Check should be if typeAttr is included, not is "not included"
line 99, call of
insertScriptsSequentially
should be checked for emptyscriptsToExecute
:The text was updated successfully, but these errors were encountered: