Repository navigation
[Bugs] Fix NodeIconImage crash on unconfigured image hosts - #1276
Conversation
…stead of throwing
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9973dd02f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| import { ARTIFACT_URL_PREFIX, resolveArtifactUrl } from '@pascal-app/core' | ||
| import Image, { type ImageProps } from 'next/image' | ||
| import { useImageConfig } from 'next/dist/client/use-image-config' |
There was a problem hiding this comment.
Preserve compatibility with the declared Next.js versions
For consumers using a supported Next.js 15 release—or even Next 16.0—this import cannot be resolved because those versions do not contain next/dist/client/use-image-config; their image component reads ImageConfigContext directly. Since @pascal-app/editor still declares next: ">=15", merely importing the editor now fails the host build. Read the config through an API/subpath available throughout the supported range, or raise the peer-dependency minimum to the version that introduced this module.
Useful? React with 👍 / 👎.
…pported Next ships
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3d0a006. Configure here.

What does this PR do?
Placing a catalog item whose thumbnail URL is on a host missing from the app's
images.remotePatterns(e.g. a production Supabase storage host while running against local Supabase) crashed the editor: the inspector header renders the thumbnail throughNodeIconImage, which always usednext/image, and Next threwInvalid src prop … hostname is not configured.NodeIconImagenow checks the src against the image confignext/imagereads (the bundler-inlined__NEXT_IMAGE_OPTS, thenImageConfigContext, thenimageConfigDefault; these modules exist across the declarednext >=15range) with Next's own matcher (hasRemoteMatch):unoptimized, which skips the loader that throws and loads the image straight from its host.artifact://thumbnails are unchanged.How to test
bun devin a host app whoseremotePatternslists only specific hosts, then place a catalog item whose thumbnail is on a host that isn't listed. The inspector opens and shows the thumbnail instead of the Next error page./_next/image.bun test src/components/ui/node-icon-image.test.tsxinpackages/editor. It covers an unconfigured host, a protocol-relative URL, a configured host, a relative path, and a config with no host lists.Ran locally: the new test, the full
packages/editorsuite (bun test src),check-typesforpackages/editor,bun run buildandbun run check.Screenshots / screen recording
N/A — non-visual change
Checklist
bun devbun checkto verify)mainbranchNote
Low Risk
Scoped UI fix in a single component with tests; unconfigured hosts skip optimization instead of failing render, with no auth or data-path changes.
Reviewed by Cursor Bugbot for commit 3055ee4. Bugbot is set up for automated code reviews on this repo. Configure here.