upchunk icon indicating copy to clipboard operation
upchunk copied to clipboard

[WebKit] Failed to load resource: WebKit encountered an internal error

Open OZIOisgood opened this issue 5 months ago • 0 comments

Hello, Mux Team & Contributors

We have discovered a bug which affects WebKit users. The error was detected while uploading a large 1.5GB file.

File:

image image

ENV:

iPhone 11 Pro Max IOS 18.0 Safari

Error:

logs:

image console_logs.txt

this.file.stream() ReadableStream request:

image

GCS PUT request:

image

Code:

  private uploadFileWithUpChunk(file: File, uploadUrl: string, onProgress: (progress: number) => void): Observable<void> {
    return from(
      new Promise<void>((resolve, reject) => {
        const upload = UpChunk.createUpload({
          endpoint: uploadUrl,
          file: file,
          dynamicChunkSize: true,
          delayBeforeAttempt: 4,
          attempts: 8,
          useLargeFileWorkaround: true
          // We have tried several variations of options here
        });

        upload.on('error', error => {
          console.error('An error occurred while uploading the file', error);

          reject(
            new Error('An error occurred while uploading the file', {
              cause: error
            })
          );
        });

        upload.on('progress', (progress: { detail: unknown }) => {
          onProgress(progress.detail as number);
        });

        upload.on('success', () => {
          resolve();
        });
      })
    );
  }

It works on Windows with the same file. It is also possible to upload the same file from IOS using simple XHR and uploadUrl.

Maybe, it is somehow related to #145 issue, but I do not have the overflow of Content-Range bytes problem (obviously, cos' I am using useLargeFileWorkaround flag).

@cjpillsbury, if it is okay to tag you here )

Please, ask for any info you would need. Thank for your replies in advance.

OZIOisgood avatar Sep 24 '24 21:09 OZIOisgood