fix: load sample#75
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the sample blueprint loading functionality by adding the /evolution-sdk/ base path prefix to the fetch URL, aligning it with the GitHub Pages deployment configuration.
Key Changes:
- Updated the fetch URL in
loadSample()to include the/evolution-sdk/prefix for GitHub Pages compatibility
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const loadSample = async () => { | ||
| try { | ||
| const response = await fetch('/sample-blueprint.json') | ||
| const response = await fetch('/evolution-sdk/sample-blueprint.json') |
There was a problem hiding this comment.
The hardcoded /evolution-sdk/ prefix will break the sample loading functionality in local development. According to next.config.mjs, the basePath is conditionally set to /evolution-sdk only in CI (GitHub Pages), but is empty in local dev mode.
Consider using Next.js's base path handling or a configuration-based approach:
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''
const response = await fetch(`${basePath}/sample-blueprint.json`)Or use a relative path that works regardless of base path:
const response = await fetch('./sample-blueprint.json')
Suggested change
| const response = await fetch('/evolution-sdk/sample-blueprint.json') | |
| const response = await fetch('./sample-blueprint.json') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.