unjs/ufo

Regex JOIN_SEGMENT_SPLIT_RE broke nuxt app

AlexXanderGrib opened this issue · 5 comments

Environment

ufo 1.5.1
iOS 15.7.2

Reproduction

https://stackblitz.com/edit/vitejs-vite-fsmpag?file=main.js,index.html&terminal=dev

Or better, just run the code on any online js evaluator:

const JOIN_SEGMENT_SPLIT_RE = /(?<!\/)\/(?!\/)/;

Describe the bug

Following line completely breaks nuxt app on iOS preventing hydration

3910926#diff-39b2554fd18da165b59a6351b1aafff3714e2a80c1435f2de9706355b4d32351R17

const JOIN_SEGMENT_SPLIT_RE = /(?<!\/)\/(?!\/)/;

image
image

Additional context

No response

Logs

No response

pi0 commented

This issue is hotfixed via #226 with ufo@1.5.2.

Please make sure to update lockfile manually (or for nuxt, using npx nuxi upgrade --force), remove node_modules if issue presists an check pnpm why ufo or npm why ufo to see why an older version of ufo might have been stalled.

Environment

nuxt: 3.11.1
ios: 16.1.2

Describe the bug

Following line completely breaks nuxt app on iOS preventing hydration

image image image image image
pi0 commented

joinRelativeURL is only a new utility that requires recent browser support. We need to check with downstream framework usages.

joinRelativeURL is only a new utility that requires recent browser support. We need to check with downstream framework usages.

"nuxt generate --dotenv .env.test" found that if it was originally corrected the code, it would be normal, but the flag was attached after the command was packaged, resulting in an abnormality in the product