Skip to content

fix(vite): run scheduled tasks during vite dev#4076

Open
RihanArfan wants to merge 2 commits intomainfrom
fix/vite-tasks
Open

fix(vite): run scheduled tasks during vite dev#4076
RihanArfan wants to merge 2 commits intomainfrom
fix/vite-tasks

Conversation

@RihanArfan
Copy link
Member

@RihanArfan RihanArfan commented Mar 5, 2026

🔗 Linked issue

Closes #3797

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Runs scheduled tasks within vite dev entrypoint.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@RihanArfan RihanArfan requested a review from pi0 as a code owner March 5, 2026 22:18
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Mar 5, 2026 11:05pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6dfcee80-b52d-4f0b-a312-98be9af55b8c

📥 Commits

Reviewing files that changed from the base of the PR and between b30796e and 9c86be1.

📒 Files selected for processing (1)
  • src/runtime/internal/vite/dev-entry.mjs

📝 Walkthrough

Walkthrough

Added a conditional startup of the schedule runner in Vite's dev entry: when runtime task metadata exists (import.meta._tasks), it calls startScheduleRunner({}) to enable task scheduling during Vite dev execution.

Changes

Cohort / File(s) Summary
Vite Dev Entry
src/runtime/internal/vite/dev-entry.mjs
Imported startScheduleRunner from #nitro/runtime/task and added if (import.meta._tasks) { startScheduleRunner({}); } after WS setup and before exporting handleUpgrade. No exported signatures changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(vite): run scheduled tasks during vite dev' follows conventional commits format with type, scope, and descriptive message.
Description check ✅ Passed The description relates to the changeset by explaining the bug fix for running scheduled tasks in vite dev and referencing the linked issue.
Linked Issues check ✅ Passed The code changes directly address issue #3797 by adding logic to start the schedule runner in the vite dev entry point when tasks metadata exists.
Out of Scope Changes check ✅ Passed All changes are focused on enabling scheduled tasks in vite dev, with no unrelated modifications to other parts of the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/vite-tasks

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks are not scheduled when running vite dev

1 participant