Skip to content

Fix DataUriSource description to include "data:" prefix#91455

Merged
mischnic merged 1 commit intocanaryfrom
claude/test-webpack-loader-errors-DJdPW
Mar 17, 2026
Merged

Fix DataUriSource description to include "data:" prefix#91455
mischnic merged 1 commit intocanaryfrom
claude/test-webpack-loader-errors-DJdPW

Conversation

@sokra
Copy link
Member

@sokra sokra commented Mar 16, 2026

What?

Fix the description() method of DataUriSource in Turbopack to include the full data: URI prefix in the display string.

Before: data URI content (svg+xml;charset=utf8,...)
After: data URI content (data:svg+xml;charset=utf8,...)

Why?

The previous implementation only included the raw data content starting from the media type, omitting the data: scheme prefix. This made the description string look malformed and not recognizable as a data URI — especially in error messages where this description is shown to developers.

The fix reconstructs the proper data URI format (data:<media_type>[;<encoding>],<data>) before truncating it to 50 characters, so the displayed prefix is a valid (partial) data URI that developers can recognize and understand.

How?

In turbopack/crates/turbopack-core/src/data_uri_source.rs, the description() function now builds the full data URI string first (data:{media_type}{sep}{encoding},{data}), then takes the first 50 characters of that. This ensures the data: scheme prefix is always present in the truncated display.

Closes NEXT-

The description now shows the full data URI prefix (e.g. "data:image/svg+xml;charset=utf8,...") instead of just the raw data content, making it clearer in error messages what the source represents.

Co-Authored-By: Claude <noreply@anthropic.com>
@nextjs-bot nextjs-bot added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Mar 16, 2026
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Mar 16, 2026

Tests Passed

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 16, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing claude/test-webpack-loader-errors-DJdPW (e308481) with canary (261922d)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sokra sokra requested a review from lukesandberg March 16, 2026 13:24
@sokra sokra marked this pull request as ready for review March 16, 2026 13:24
Copy link
Contributor

@lukesandberg lukesandberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukesandberg approved this PR from Slack with Graphite

@mischnic mischnic merged commit 9eed302 into canary Mar 17, 2026
294 of 300 checks passed
Copy link
Member

Merge activity

@mischnic mischnic deleted the claude/test-webpack-loader-errors-DJdPW branch March 17, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants