Skip to content

fix: end route module ids in the source extension so unplugin filters match - #2242

Closed
birkskyum wants to merge 2 commits into
solidjs:mainfrom
birkskyum:fix-issue-1374
Closed

fix: end route module ids in the source extension so unplugin filters match#2242
birkskyum wants to merge 2 commits into
solidjs:mainfrom
birkskyum:fix-issue-1374

Conversation

@birkskyum

Copy link
Copy Markdown
Member

Route files are requested with a ?pick=... query, leaving ids like src/routes/index.tsx?pick=default&pick=$css. That does not end in .tsx, so plugins filtering with an end-anchored extension regex (/\.[jt]sx?$/, the default in unplugin-auto-import and friends) silently skip every route file.

The query now ends with &lang.<ext>, the same convention @vitejs/plugin-vue uses for ?vue&type=script&lang.ts. The three places that built this string share a toRouteModuleId() helper.

That change moves the query into Rollup's chunk base name, so sanitizeRouteChunkName strips it back off via output.sanitizeFileName. Output filenames are unchanged from before this PR.

Verified with stock AutoImport({ dirs: [...] }) and no include override: the import is now injected into route chunks, in both build and dev. Existing suites pass (64 unit, 30 e2e, 30 bundled-dev), all fixtures build.

@changeset-bot

changeset-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ccfd266

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit ccfd266
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a65fefc09423100082e6803
😎 Deploy Preview https://deploy-preview-2242--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2242

commit: ccfd266

@birkskyum birkskyum added Start 2.x targeting SolidStart 2.x versions file routes labels Jul 26, 2026
@birkskyum

Copy link
Copy Markdown
Member Author

Superseded by #2249, which landed the same fix on main: the same lang.<ext> marker on route module ids, plus the same chunk-name sanitizer to keep filenames unchanged. Its toPickId also guards on the script extensions, so .md/.mdx routes keep the old id shape, which is better than what this PR did.

That leaves nothing here but a changeset, which is now #2254.

#1374 (the unplugin-auto-import report this PR was aimed at) is fixed by #2249 for the same reason #1918 was.

@birkskyum birkskyum closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

file routes Start 2.x targeting SolidStart 2.x versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: unplugin-icons + unplugin-auto-import don't work within filesystem routes

1 participant