Skip to content

Multipart upload fails with throttleit module export error #843

@Type-32

Description

@Type-32

Describe the bug
Multipart upload handling emits weird package related bug (on the frontend console, no errors on backend) when trying to upload the file:

XHRPOST
http://localhost:3000/api/upload/create/User Roles.pdf
[HTTP/1.1 400 Server Error 2048ms]

Uncaught (in promise) FetchError: [POST] "/api/upload/create/User Roles.pdf": 400 Server Error
    NuxtJS 37
undefined:6:5
    $fetch2 NuxtJS
    AsyncFunctionThrow self-hosted:784
    NuxtJS 36

Upload failed: SyntaxError: The requested module 'http://localhost:3000/_nuxt/@fs/D:/OD/Windows%20Defaults/Documents/WebStorm%20Projects/mpupload-moduledefault-repro/node_modules/.pnpm/throttleit@2.1.0/node_modules/throttleit/index.js?v=cc799fc8' doesn't provide an export named: 'default' index.vue:30:21
    NuxtJS 34
        startUpload
        callWithErrorHandling
        callWithAsyncErrorHandling
        invoker
    (Async: EventListener.handleEvent)
        addEventListener
        patchEvent
        patchProp
        hydrateElement
        hydrateNode
        hydrateChildren
        hydrateElement
        hydrateNode
        hydrateSubTree
        componentUpdateFn
        run
        setupRenderEffect
        mountComponent
        hydrateNode
        hydrateSubTree
        componentUpdateFn
        run
        setupRenderEffect
        mountComponent
        hydrateNode
        hydrateSuspense
        hydrateNode
        hydrateSubTree
        componentUpdateFn
        run
        setupRenderEffect
        mountComponent
        hydrateNode
        hydrateSubTree
        componentUpdateFn

env variables are there but just somehow can't get it to work.

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/Type-32/mpuupload-moduledefault-repo and clone the reproduction repo
  2. Set your Vercel Blob read write token in .env
  3. Use bun or pnpm to install and run the project
  4. See error

Expected behavior
The file should've be uploaded to the blob storage; The test file I used to upload, "User Roles.pdf", is a standard pdf of 47KB in size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions