Skip to content

Conversation

@fraidev
Copy link
Contributor

@fraidev fraidev commented Nov 3, 2025

Fixes: denoland/deno#30688

Summary

Deno currently panics when the same JavaScript module is loaded more than once, which can easily happen when using the --preload flag.

For example:

deno run --preload ./main.ts main.ts

What this PR does

This PR updates the module loading logic to ignore modules that have already been loaded, preventing duplicate imports and avoiding the panic.

Other Runtimes

Both Bun (--preload) and Node.js (--import) already handle this case by skipping already loaded modules.

@CLAassistant
Copy link

CLAassistant commented Nov 3, 2025

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 96.77419% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.73%. Comparing base (0c7f83e) to head (2b5f902).
⚠️ Report is 357 commits behind head on main.

Files with missing lines Patch % Lines
core/modules/map.rs 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1221      +/-   ##
==========================================
- Coverage   81.43%   79.73%   -1.71%     
==========================================
  Files          97      100       +3     
  Lines       23877    26077    +2200     
==========================================
+ Hits        19445    20792    +1347     
- Misses       4432     5285     +853     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fraidev fraidev marked this pull request as ready for review November 3, 2025 12:12
@bartlomieju bartlomieju merged commit 5e8def2 into denoland:main Nov 3, 2025
18 checks passed
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.

4 participants