huggingface / huggingface/competitions

Safari-specific bug -> SyntaxError: The string did not match the expected pattern when submitting in script competition

Open
#66 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
125
Forks
14
Avg merge
15m
Merged PRs (30d)
1

Description

On Safari, clicking the submit button in a script competition throws a `SyntaxError: The string did not match the expected pattern` in the browser console and the form never submits. The same submission works correctly on Chrome.

No POST request reaches the server (confirmed via uvicorn logs), the error is thrown client-side before the fetch is sent. Safari's URL constructor is stricter than Chrome's. Somewhere in the submission JavaScript, new URL(hubModel) (or equivalent) is called on the raw hub_model field value (e.g. "username/repo"). Since this is not a fully-qualified URL, Safari throws:

`SyntaxError: The string did not match the expected pattern.`
Chrome handles this differently and the fetch proceeds normally.

**Steps to reproduce**
Create a competition Space
Open the Space in Safari
Enter a valid model repo ID (e.g. username/my-model) in the submission form
Click Submit → SyntaxError thrown, no submission sent

**Expected behavior**
The submission should work on Safari the same as Chrome. The hub_model value should be validated as a repo ID (username/repo-name format), not parsed as a full URL.

**Environment**
Browser: Safari (does not reproduce on Chrome)
Competition type: any

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.