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

Invalid regular expression: invalid group specifier name (Safari version <= 16.3) #26393

Closed
Rizzato95 opened this issue Mar 20, 2024 · 3 comments

Comments

@Rizzato95
Copy link

Environment

  • Operating System: macOS Monterey (Safari v15.5)
  • Node Version: v20.9.0
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.0
  • Nitro Version: 2.9.4
  • Package Manager: yarn@1.22.19
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/p/devbox/amazing-liskov-t4f3q4

Describe the bug

After upgrading Nuxt from v3.10.3 to v3.11.1 I get this error when I try to show the application from a Safari browser with a version <= 16.3.

For reproduce the issue I started from the Nuxt 3 base template (who is working) and I added a simple page.

It seems like some regular expression aren't supported in this browser version (as you can read HERE)

Safari v15.5:
image

Safari v17.3:

image

Additional context

No response

Logs

No response

@hankdetank
Copy link

hankdetank commented Mar 20, 2024

I think the following information could be usefull.
image

Quick edit: Just tested on a older version of Safari. And the problem is this:
new RegExp("(?<!\/)\/(?!\/)");
image

@manniL
Copy link
Member

manniL commented Mar 20, 2024

Related to ufo - https://github.com/unjs/ufo/blob/c84812a178d07168d44e6ad29ad3e2da9b9a06ea/src/utils.ts#L349 - unjs/ufo#224

cc @pi0

@Rizzato95 @hankdetank try updating ufo to the latest (1.5.2) by refreshing the lockfile as there has been a hotfix. But as nuxt is using the function for public paths (

'import { joinRelativeURL as joinURL } from \'ufo\'',
) it might not fix it.

@pi0
Copy link
Member

pi0 commented Mar 20, 2024

Browser compatibility with ufo.joinRelativeURL is increased in ufo@1.5.3 (via unjs/ufo#228).

Please make sure to update the lock file manually (or using npx nuxi upgrade --force), remove node_modules if the issue exists, and check pnpm why ufo or npm why ufo to see why an older version of ufo might have been stalled.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants