fix(blocks): resolve the Create preview iframe under the Pages basePath - #41
Merged
Merged
Conversation
…w iframe resolves BLOCKS_PAGES is only visible to server code, so in the browser withBase() dropped the /blocks basePath and the Create page embedded /blocks/create/preview/, which 404s on GitHub Pages and rendered the docs shell inside itself. next.config now inlines a NEXT_PUBLIC_BLOCKS_PAGES mirror and site.ts checks both, so the iframe points at /blocks/blocks/create/preview/. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Review complete. No issues found — approved ✅. This small PR (2 files, ~30 diff lines) touches the blocks documentation app's Next.js config and its shared site library. The scan passed the changed files through correctness and holistic review with no findings above threshold, so no inline comments were produced and no defects were flagged for the author.
Reviewed commit: adf0ea5 |
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.
Summary
On the deployed site,
/blocks/blocks/create/embedded/blocks/create/preview/— the basePath was missing — so GitHub Pages served the 404 page and the docs shell rendered inside itself (the "inception" screenshot).BLOCKS_PAGESis a plain env var, so it is only defined for server code.withBase()runs in the browser for the preview iframe (preview-frame.tsx), whereBASE_PATHevaluated to''.next.config.tsinlines aNEXT_PUBLIC_BLOCKS_PAGESmirror into the client bundle andsite.tschecks both variables.Verified against a real
pnpm build:pagesexport served under/blocks/: clicking Create yieldsiframe src="/blocks/blocks/create/preview/?d=…", the preview renders the platform wall, no nested frame, no 4xx responses.Generated with Devin