pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
4.13k stars 305 forks source link

[bug]: Effect package version mismatch? #870

Closed MGSimard closed 3 months ago

MGSimard commented 3 months ago

Provide environment information

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 14.20 GB / 31.95 GB
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.68)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @uploadthing/react: ^6.7.0 => 6.7.0
    typescript: ^5.4.2 => 5.5.2
    uploadthing: ^6.13.0 => 6.13.0

Describe the bug

On attempting to upload image via the uploadthing button:

IN BROWSER: POST http://localhost:3000/api/uploadthing?actionType=upload&slug=imageUploader 500 (Internal Server Error)

VSCODE TERMINAL: โจฏ (FiberFailure) RuntimeException: Cannot execute an Effect versioned 3.4.4 with a Runtime of version 3.4.2 at C:\Users\XXX\Desktop\XXX\react\teethreegeegee\.next\server\chunks\633b9_effect_dist_esm_internal_core_cdae7d.js:616:241 POST /api/uploadthing?actionType=upload&slug=imageUploader 500 in 98ms

As far as I can tell, the issue seems to be: node_modules/effect being installed at v3.4.4 and @effect/schema following through by having peerDependencies effect 3.4.4 while uploadthing still wants 3.4.2? Looking at your minimal template it's the same thing there.

Link to reproduction

https://stackblitz.com/github/pingdotgg/uploadthing/tree/main/examples/minimal-appdir?file=package-lock.json

To reproduce

Create the usual t3 app, install uploadthing and set up normally, try to use file upload feature, get mismatching effect version error. As for repro link, ctrl+f 3.4.4 & 3.4.2 to see what I think is the mismatch

Additional information

Haven't had to deal with such an issue yet, so I don't know if my idea is right or if it's just a skill issue on my part and it's just a coincidence.

๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributing

Code of Conduct

MGSimard commented 3 months ago

After 3 hours of solid sleep due to noisy neighbours I went into the project and manually downgraded @effect/schema to 0.68.9 with effect 3.4.2 - this fixed the problem. Looking at minimal template again uploadthing still goes for effect 3.4.2 while @effect/schema gets 3.4.5 (updated overnight). Not an expert but doesn't that mean that uploadthing has a hardcoded effect version requirement (3.4.2) while also installing @effect/schema & effect as latest version, causing the mismatch or something?

PrivFelixKniest commented 3 months ago

Had this same error after installing the newest update a couple hours ago... Will try manually downgrading the library aswell

PrivFelixKniest commented 3 months ago

That fixed it for me aswell. Maybe someone upgraded the package version and didnt find this braking change -> should be reverted asap and seams like an easy fix

npm install @effect/schema@0.68.9
npm install effect@3.4.2
sneh-soni commented 3 months ago

That fixed it for me aswell. Maybe someone upgraded the package version and didnt find this braking change -> should be reverted asap and seams like an easy fix

npm install @effect/schema@0.68.9
npm install effect@3.4.2

Worked for me as well ๐Ÿ‘