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

Rename manager UI mjs to js #22244

Closed
shilman opened this issue Apr 25, 2023 · 11 comments · Fixed by #22247
Closed

Rename manager UI mjs to js #22244

shilman opened this issue Apr 25, 2023 · 11 comments · Fixed by #22247
Assignees
Labels
core maintenance User-facing maintenance tasks sev:S2

Comments

@shilman
Copy link
Member

shilman commented Apr 25, 2023

Describe the bug

Users on Github pages / AWS / Nginx and other servers are having problems with the .mjs files shipped with Storybook's Manager UI:

The general solution is to make our packages type: module and rename those files to .js. We plan to do this for 8.0. However, there are a lot of thorny issues there and we don't have any near-term plans for an 8.0 release.

That said, this appears to be a problem primarily with the Manager UI package. This package is special because it's entirely pre-bundled and self-contained (nothing depends on it).

Therefore, we propose to update the Manager UI to type module and have it run its own build script that generates .js files instead of .mjs. This will hopefully solve the user problems above without introducing all of the complexities or breaking changes associated with a wholesale move to type: module

To Reproduce

No response

System

No response

Additional context

No response

@shilman
Copy link
Member Author

shilman commented Apr 25, 2023

Ta-da!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.9 containing PR #22247 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

@tianlmn
Copy link

tianlmn commented Apr 26, 2023

Ta-da!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.9 containing PR #22247 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

GET http://localhost:8866/sb-preview/runtime.js net::ERR_ABORTED 404 (Not Found)

@ndelangen
Copy link
Member

@tianlmn do you have a reproduction repo for me?

@httpete
Copy link

httpete commented May 2, 2023

I still see this file 404 from Github pages, the rest are totally fine, if I serve it up locally with npx http-server it is fine.

assets/_commonjs-dynamic-modules-302442b1.js, it comes through with the wrong header.

@httpete
Copy link

httpete commented May 2, 2023

AH! I fixed this by bypassing jekyll:

https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/

@shilman
Copy link
Member Author

shilman commented May 3, 2023

ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.8 containing PR #22247 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

@ix-xerri
Copy link

@shilman Still happening after upgrade to 7.0.24GET http://localhost:6006/sb-preview/runtime.js 404 (Not Found)

@ndelangen
Copy link
Member

Please supply a reproduction

@ix-xerri
Copy link

I can't provide the whole storybook. Is there a particular file can make use of?

@ndelangen
Copy link
Member

@ix-xerri unfortunately not. Most likely there's something "off" in your dependencies / lockfile.
If you could make a minimal reproduction that would allow me to investigate.

@ix-xerri
Copy link

hmm part of the reason is that the upgrade was removing @storybook/builder-vite": "^7.0.24 even though i was using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core maintenance User-facing maintenance tasks sev:S2
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants