Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(nitro): do not add import condition for ssr resolve conditions#34739

Merged
danielroe merged 1 commit into
nuxt:mainfrom
yamachi4416:not-add-import-resolve-condition-to-ssr
Apr 19, 2026
Merged

fix(nitro): do not add import condition for ssr resolve conditions#34739
danielroe merged 1 commit into
nuxt:mainfrom
yamachi4416:not-add-import-resolve-condition-to-ssr

Conversation

@yamachi4416

@yamachi4416 yamachi4416 commented Mar 30, 2026

Copy link
Copy Markdown
Member

πŸ”— Linked issue

πŸ“š Description

fixed a module resolution issue (thanks to the vitest team for the investigation here).
modified ssr resolve.conditions to exclude import. this is already resolved in nitro-v3 the pr.
added an import filter, but it can be removed once nitropack supports it or upon full migration to nitro-v3.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions Bot added 5.x πŸ› bug Something isn't working as expected labels Mar 30, 2026
@pkg-pr-new

pkg-pr-new Bot commented Mar 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@34739

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@34739

nuxt

npm i https://pkg.pr.new/nuxt@34739

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@34739

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@34739

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@34739

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@34739

commit: 8587314

@codspeed-hq

codspeed-hq Bot commented Mar 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

βœ… 20 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing yamachi4416:not-add-import-resolve-condition-to-ssr (8587314) with main (8c078f4)2

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. ↩

  2. No successful run was found on main (9f8be5f) during the generation of this report, so 8c078f4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@yamachi4416 yamachi4416 marked this pull request as ready for review March 30, 2026 11:03
@yamachi4416 yamachi4416 requested a review from danielroe as a code owner March 30, 2026 11:03
@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The change modifies the SSR Vite environment configuration within the bundle function. Previously, the 'import' condition was unconditionally added to config.resolve.conditions. The code now sets config.resolve.conditions exclusively to the values from nitro.options.exportConditions, then explicitly filters out the 'import' condition with a TODO annotation for removal in v5.

πŸš₯ Pre-merge checks | βœ… 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (2 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately and concisely describes the main change: preventing the 'import' condition from being added to SSR resolve conditions.
Description check βœ… Passed The pull request description is directly related to the changeset, clearly explaining the module resolution issue being fixed and referencing relevant upstream issues and PRs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe danielroe added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@danielroe danielroe added this pull request to the merge queue Apr 19, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 19, 2026
@danielroe danielroe added this pull request to the merge queue Apr 19, 2026
Merged via the queue into nuxt:main with commit c271492 Apr 19, 2026
37 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 19, 2026
4 tasks
@yamachi4416 yamachi4416 deleted the not-add-import-resolve-condition-to-ssr branch April 20, 2026 23:14
@github-actions github-actions Bot mentioned this pull request Apr 18, 2026
@github-actions github-actions Bot mentioned this pull request Apr 25, 2026
@danielroe

Copy link
Copy Markdown
Member

@yamachi4416 I've reverted this for both 4.x and 3.x branches as it was causing issues with vue-router v5.

I'd happily re-open this, but let's do it against just 4.x to test properly πŸ™

@yamachi4416

Copy link
Copy Markdown
Member Author

@danielroe
thank you so much πŸ™
I will try to resolve and test it against the 4.x branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.x 5.x πŸ› bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants