Skip to content

fix(build): avoid replacing window$1#3672

Merged
pi0 merged 11 commits intov2from
fix/replace-backport
Oct 23, 2025
Merged

fix(build): avoid replacing window$1#3672
pi0 merged 11 commits intov2from
fix/replace-backport

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Oct 23, 2025

Backporting another fix of #3671 by @9romise to v2 to address vueuse/vueuse#5114 in current versions (used by Nuxt).

(thanks to @43081j helping ❤️)

@vercel
Copy link

vercel bot commented Oct 23, 2025

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

Project Deployment Preview Comments Updated (UTC)
nitro.build Ready Ready Preview Comment Oct 23, 2025 11:25am

@pi0 pi0 changed the base branch from main to v2 October 23, 2025 10:38
@pi0 pi0 changed the title fix/replace backport fix(build): avoid replacing unexpected words Oct 23, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

Open in StackBlitz

npm i https://pkg.pr.new/nitrojs/nitro/nitropack@3672

commit: 14f347e

@pi0 pi0 marked this pull request as ready for review October 23, 2025 11:13
@pi0 pi0 marked this pull request as draft October 23, 2025 11:15
@pi0
Copy link
Member Author

pi0 commented Oct 23, 2025

After a few investigations, changing delimiters is not easily backportable to Nitro v2, as we need raw code replacements like import.meta.* (this is not the case for upcoming Nitro v3 anymore, but the issue is today...)

One alternative hotfix was be to specially handle the window$1 case and preserve it as is (without treeshaking like window)

/cc @9romise @antfu @OrbisK

@pi0 pi0 marked this pull request as ready for review October 23, 2025 11:24
@pi0 pi0 changed the title fix(build): avoid replacing unexpected words fix(build): avoid replacing window$1 Oct 23, 2025
@pi0 pi0 merged commit d9ee35f into v2 Oct 23, 2025
7 checks passed
@pi0 pi0 deleted the fix/replace-backport branch October 23, 2025 11:32
@pi0
Copy link
Member Author

pi0 commented Oct 23, 2025

Merging limited replacement as a temporary hotfix for v2.

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