Skip to content

Check Dynamically Cached Module First #913

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mookums
Copy link
Contributor

@mookums mookums commented Jul 23, 2025

This just reorders how the dynamic import works. It checks the module cache first and fixes a crash experienced when a module is compiled while it is in the .kEvaluating state.

@mookums mookums requested a review from karlseguin July 23, 2025 02:00
.kEvaluated, .kEvaluating => {
const namespace = new_module.getModuleNamespace();
log.info(.js, "dynamic import complete", .{
.module = new_module,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two are opaque values, they print meaningless data.

_ = resolver.resolve(ctx, namespace);
return;
},
else => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still in the if (cached) block. If the module is cached, why are we loading it again?

return;
};
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I following the indentation, wrong, or is this not the end of the if (cached) block, shouldn't there be if not cached handling?

@mookums mookums force-pushed the get-cached-dynamic-module-first branch from 8deb30f to bc9f0b9 Compare July 30, 2025 22:46
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.

2 participants