Skip to content

fix(Option): guard isScript and isStyle against null resource#192

Merged
webdiscus merged 1 commit into
webdiscus:masterfrom
SAY-5:fix/option-isscript-null
May 31, 2026
Merged

fix(Option): guard isScript and isStyle against null resource#192
webdiscus merged 1 commit into
webdiscus:masterfrom
SAY-5:fix/option-isscript-null

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Closes #191.

In webpack watch mode, MultiCompiler propagates invalidate events with null as the filename, and AssetCompiler.invalidate passes that through to Option.isScript. The current resource.split('?', 1) crashes with TypeError and terminates the watcher when any source file is deleted. Bail out with false when resource is null so deletions don't kill watch mode.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@webdiscus

Copy link
Copy Markdown
Owner

Hello @SAY-5,

thanks for your contribution!

@webdiscus
webdiscus merged commit f467e86 into webdiscus:master May 31, 2026
4 checks passed
@webdiscus webdiscus added the bug Something isn't working label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read properties of null (reading 'split') in watch mode when a file is deleted

2 participants