Skip to content
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

test: css addWatchFile in load hook #18103

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

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Sep 13, 2024

Description

Adds a failing test for CSS that relies on the load hook and calls this.addWatchFile there, which doesn't work currently (in v6 only).

The reason is because of here:

private _updateModuleLoadAddedImports(
id: string,
addedImports: Set<string> | null,
): void {
const module = this.moduleGraph?.getModuleById(id)
if (module) {
this._moduleNodeToLoadAddedImports.set(module, addedImports)
}
}

The module does not exist until the load hook finishes here:

// ensure module in graph after successful load
mod ??= await moduleGraph._ensureEntryFromUrl(url, undefined, resolved)

I'm not entirely sure why it worked in v5 yet (for SPA only). But for SSR, I know that since the module nodes are shared, the pluginContainer can share the client module node after ssr already created the module node.

Copy link

stackblitz bot commented Sep 13, 2024

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

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.

1 participant