-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(schema,vite): bump requestTimeout + allow configuration
#32874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
WalkthroughThis change introduces a new optional Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (3)📚 Learning: in nuxt, using `rolldownversion` (not `rollupversion`) is intentional when detecting if rolldown-vit...Applied to files:
📚 Learning: in `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distdir` are l...Applied to files:
📚 Learning: applies to **/*.{test,spec}.{ts,tsx,js,jsx} : write unit tests for core functionality using `vitest`...Applied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (4)
✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThe changes introduce new optional configuration properties— Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes ✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/vite/src/runtime/vite-node-shared.mjs (1)
19-22: Validate and coerce env-supplied values to numbers
process.env.NUXT_VITE_NODE_OPTIONSis parsed from JSON, but users (or future tooling) might still inject string values.
Using the numeric operators later (Math.pow, comparisons) will coerce strings implicitly but hides invalid/NaN input and may break the exponential-back-off if e.g."abc"is supplied.Consider an explicit coercion + fallback:
-const MAX_RETRY_ATTEMPTS = viteNodeOptions.maxRetryAttempts ?? 5 -const BASE_RETRY_DELAY_MS = viteNodeOptions.baseRetryDelay ?? 100 -const MAX_RETRY_DELAY_MS = viteNodeOptions.maxRetryDelay ?? 2000 -const REQUEST_TIMEOUT_MS = viteNodeOptions.requestTimeout ?? 60_000 +const toNumber = (v, d) => Number.isFinite(+v) ? +v : d + +const MAX_RETRY_ATTEMPTS = toNumber(viteNodeOptions.maxRetryAttempts, 5) +const BASE_RETRY_DELAY_MS = toNumber(viteNodeOptions.baseRetryDelay, 100) +const MAX_RETRY_DELAY_MS = toNumber(viteNodeOptions.maxRetryDelay, 2000) +const REQUEST_TIMEOUT_MS = toNumber(viteNodeOptions.requestTimeout, 60_000)This guards against accidental mis-configuration without impacting the happy path.
packages/vite/src/vite-node.ts (1)
193-197: Normalise config values to numbers before serialisingThe four new options are forwarded verbatim from
nuxt.options.vite.viteNode.
If a user sets them as strings innuxt.config.ts(common when pulling from env vars), they are serialised unchanged and the runtime must then coerce them.Doing the coercion once here avoids duplication and keeps
vite-node-sharedlean:maxRetryAttempts: Number(nuxt.options.vite.viteNode?.maxRetryAttempts) || undefined, baseRetryDelay: Number(nuxt.options.vite.viteNode?.baseRetryDelay) || undefined, maxRetryDelay: Number(nuxt.options.vite.viteNode?.maxRetryDelay) || undefined, requestTimeout: Number(nuxt.options.vite.viteNode?.requestTimeout) || undefined,This keeps the JSON payload strictly numeric and protects against invalid input early.
packages/schema/src/types/schema.ts (1)
1650-1660: Minor: add default values / unit hints in the JSDocThe new
viteNodeschema is great, but documenting defaults (5, 100 ms, 2000 ms, 60000 ms) and units makesschema.d.tsself-explanatory for consumers and IDE tooltips.No code change required – only JSDoc refinement.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/schema/src/types/schema.ts(1 hunks)packages/vite/src/runtime/vite-node-shared.mjs(1 hunks)packages/vite/src/vite-node.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
Follow standard TypeScript conventions and best practices
Files:
packages/schema/src/types/schema.tspackages/vite/src/vite-node.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: TheAlexLichter
PR: nuxt/nuxt#31812
File: packages/nuxt/src/components/plugins/islands-transform.ts:202-202
Timestamp: 2025-04-18T18:33:41.753Z
Learning: In Nuxt, using `rolldownVersion` (not `rollupVersion`) is intentional when detecting if rolldown-vite is being used, even though TypeScript may show an error because the property isn't in standard type definitions yet.
📚 Learning: in nuxt, using `rolldownversion` (not `rollupversion`) is intentional when detecting if rolldown-vit...
Learnt from: TheAlexLichter
PR: nuxt/nuxt#31812
File: packages/nuxt/src/components/plugins/islands-transform.ts:202-202
Timestamp: 2025-04-18T18:33:41.753Z
Learning: In Nuxt, using `rolldownVersion` (not `rollupVersion`) is intentional when detecting if rolldown-vite is being used, even though TypeScript may show an error because the property isn't in standard type definitions yet.
Applied to files:
packages/schema/src/types/schema.tspackages/vite/src/vite-node.ts
📚 Learning: applies to **/*.{test,spec}.{ts,tsx,js,jsx} : write unit tests for core functionality using `vitest`...
Learnt from: CR
PR: nuxt/nuxt#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T16:46:07.446Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Write unit tests for core functionality using `vitest`
Applied to files:
packages/schema/src/types/schema.ts
📚 Learning: in `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distdir` are l...
Learnt from: GalacticHypernova
PR: nuxt/nuxt#26468
File: packages/nuxt/src/components/plugins/loader.ts:24-24
Timestamp: 2024-11-05T15:22:54.759Z
Learning: In `packages/nuxt/src/components/plugins/loader.ts`, the references to `resolve` and `distDir` are legacy code from before Nuxt used the new unplugin VFS and will be removed.
Applied to files:
packages/vite/src/vite-node.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: test-fixtures (ubuntu-latest, built, webpack, default, manifest-on, json, 20)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, default, manifest-off, json, 20)
- GitHub Check: test-fixtures (ubuntu-latest, built, vite, async, manifest-on, json, 20)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-on, json, 20)
- GitHub Check: test-fixtures (ubuntu-latest, dev, vite, async, manifest-off, json, 20)
- GitHub Check: release-pkg-pr-new
- GitHub Check: code
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #32874 will not alter performanceComparing Summary
Footnotes |
🔗 Linked issue
resolves #32789
📚 Description
this bumps the timeout for vite-node fetches to 1 minute and allows configuring this interval