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

fix: getSandboxUrl when base="" served in subdirectory (fix #652,#635) #687

Closed
wants to merge 6 commits into from

Conversation

mswertz
Copy link

@mswertz mswertz commented Feb 19, 2024

This fixes issue when users use histoire using relative paths in a subdirectory.

Workaround is still <Story :layout="{ type: 'grid', width: '75%' }"> as mentioned in #635

Description

This enhances recent PR #652 that made break our histoire setup while using a relative path. We use base = "" however run it in a subfolder so adding the '/' actually breaks it, see image. When I fixed it in my local node_modules folder the code committed solved it.

Additional context

N.B. I am using the nuxt extension. Without this fix I get the following error:

image

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • If it's a new feature, provide a convincing reason to add it. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

This fixes issue when users use histoire using relative paths in a subdirectory.
Copy link

codesandbox bot commented Feb 19, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

stackblitz bot commented Feb 19, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Feb 19, 2024

Deploy Preview for histoire-examples-svelte3 ready!

Name Link
🔨 Latest commit 858be77
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/65d9fb0ef0b75d0008573c37
😎 Deploy Preview https://deploy-preview-687--histoire-examples-svelte3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 19, 2024

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit 858be77
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/65d9fb0ebbe9a30008f28b05
😎 Deploy Preview https://deploy-preview-687--histoire-examples-vue3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 19, 2024

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit 858be77
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/65d9fb0efc17550008040c7a
😎 Deploy Preview https://deploy-preview-687--histoire-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 19, 2024

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit 858be77
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/65d9fb0e32add90008760105
😎 Deploy Preview https://deploy-preview-687--histoire-controls.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mswertz mswertz changed the title fix: relative paths when having base = "" fix: relative paths to __sandbox.html when having base = "" Feb 19, 2024
@mswertz mswertz marked this pull request as draft February 19, 2024 21:59
@mswertz mswertz closed this Feb 19, 2024
@mswertz mswertz reopened this Feb 19, 2024
@mswertz mswertz changed the title fix: relative paths to __sandbox.html when having base = "" fix: sandbox URL in getSandboxUrl function when in subdirectory with base = "" (i.e. relative paths) Feb 19, 2024
@mswertz mswertz changed the title fix: sandbox URL in getSandboxUrl function when in subdirectory with base = "" (i.e. relative paths) fix: getSandboxUrl function when in subdirectory with base = "" (i.e. relative paths) Feb 19, 2024
@mswertz mswertz changed the title fix: getSandboxUrl function when in subdirectory with base = "" (i.e. relative paths) fix: getSandboxUrl function when in subdirectory Feb 19, 2024
@mswertz mswertz marked this pull request as ready for review February 19, 2024 23:18
@mswertz mswertz changed the title fix: getSandboxUrl function when in subdirectory fix: getSandboxUrl function when base="" and published in subdirectory Feb 24, 2024
@mswertz mswertz changed the title fix: getSandboxUrl function when base="" and published in subdirectory fix #652: getSandboxUrl function when base="" and published in subdirectory Feb 24, 2024
@mswertz mswertz changed the title fix #652: getSandboxUrl function when base="" and published in subdirectory fix: getSandboxUrl function when base="" and published in subdirectory (fix #652) Feb 24, 2024
@mswertz mswertz changed the title fix: getSandboxUrl function when base="" and published in subdirectory (fix #652) fix: getSandboxUrl function when base="" and published in subdirectory (fix #652,#635) Feb 24, 2024
@mswertz mswertz changed the title fix: getSandboxUrl function when base="" and published in subdirectory (fix #652,#635) fix: getSandboxUrl when base="" and in subdirectory (fix #652,#635) Feb 24, 2024
@mswertz mswertz changed the title fix: getSandboxUrl when base="" and in subdirectory (fix #652,#635) fix: getSandboxUrl when base="" served in subdirectory (fix #652,#635) Feb 24, 2024
@Mobyrr
Copy link
Contributor

Mobyrr commented Mar 11, 2024

the base shouldn't be modified, it should have a slash at the start and at the end (every guide from vite about configuring this have them), adding a slash at the end is wrong

@Akryum
Copy link
Member

Akryum commented Mar 13, 2024

Thanks for the PR! Closing in favor of #698

@Akryum Akryum closed this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants