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

Make absolute path for dlls relative #5055

Closed
cmwhiting opened this issue Dec 20, 2018 · 11 comments
Closed

Make absolute path for dlls relative #5055

cmwhiting opened this issue Dec 20, 2018 · 11 comments
Assignees
Milestone

Comments

@cmwhiting
Copy link

The dlls are loaded as dlls: ['/sb_dll/storybook_ui_dll.js'] in @storybook/core/src/server/manager/manager-webpack.config.js, but if you're serving static files outside of the root directory, this will fail. This should hopefully be something relative, like dlls: ['sb_dll/storybook_ui_dll.js'] or dlls: ['./sb_dll/storybook_ui_dll.js']

Ex: I have a node server stood up on localhost:4000, serving from ./public. I change my storybook output directory to ./public/storybook. The files are created, and loading localhost:4000/storybook serves the page, but requests localhost:4000/sb_dll/storybook_ui_dll.js, which doesn't exist. With relative pathing, it would request as localhost:4000/storybook/sb_dll/storybook_ui_dll.js, which would resolve correctly.

@ozio
Copy link

ozio commented Dec 27, 2018

Same problem. We have a several environments and want to put storybooks to each of them as a subfolder, but we can't because of that absolute path. Had tried to change publicPath in webpack config, but it works only for paths in iframe.html.

@gpincheiraa
Copy link

Same problem here!

@unindented
Copy link

I'm also affected by this. In my case, I'm publishing to GitHub Pages, which are always https://<user>.github.io/<project>/, so storybook_ui_dll.js can never be found.

@Pluzu
Copy link

Pluzu commented Jan 4, 2019

Same problem here

@dangerdespain
Copy link
Contributor

+1, I'm affected by this as well

@dangerdespain
Copy link
Contributor

For anyone else running across this, here's a build command that should fix this temporarily

{
  "scripts" : {
    "build-storybook": "rm -rf storybook-static && build-storybook && sed -i -e 's/\\\/sb_dll/sb_dll/g' storybook-static/index.html"
  }
}

@ndelangen
Copy link
Member

I'm going to fix this ASAP

@shilman
Copy link
Member

shilman commented Jan 14, 2019

Boo-yah!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.0-alpha.1 containing PR #5238 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

@shilman
Copy link
Member

shilman commented Jan 15, 2019

Mind giving this a try and letting me know if it works for you? If so, I'll cherry-pick this back to master and do a patch release. Thanks!

@cmwhiting @mysticatea @alex996 @ozio @asychev @Chariyski @baohouse @benjablanko @gpincheiraa @Stevo14850 @unindented @liss-mouse @vio @Pluzu @lauriejones @yhuard @johnhunter @heavenshell @dkimura @dangerdespain @ndelangen

@ozio
Copy link

ozio commented Jan 15, 2019

Already. Can confirm that new path is relative: ./sb_dll/storybook_ui_dll.js instead of /sb_dll/storybook_ui_dll.js.

@ndelangen ndelangen added this to the v5.0.0 milestone Jan 17, 2019
billyvg added a commit to getsentry/sentry that referenced this issue Jan 17, 2019
storybook DLL was not being loaded because of absolute path

Fixed in storybookjs/storybook#5055 but not merged into their stable branch yet.
@shilman
Copy link
Member

shilman commented Jan 23, 2019

Whoopee!! I just released https://github.com/storybooks/storybook/releases/tag/v4.1.9 containing PR #5238 that references this issue. Upgrade today to try it out!

bweissbart added a commit to bweissbart/flagship that referenced this issue Mar 27, 2019
This appears to resolve an issue in regards to absolute vs relative path for the dll javascript bundle: storybookjs/storybook#5055
DavidRhodesBB pushed a commit to brandingbrand/flagship that referenced this issue Mar 28, 2019
This appears to resolve an issue in regards to absolute vs relative path for the dll javascript bundle: storybookjs/storybook#5055
crherman7 pushed a commit to crherman7/flagship that referenced this issue Nov 14, 2022
This appears to resolve an issue in regards to absolute vs relative path for the dll javascript
bundle: storybookjs/storybook#5055

brandingbrand-source-id: 90b5f838b4f335e0a059dd898ee1bc30a28aba6a
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

9 participants