pingdotgg / uploadthing

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

[bug]: Module not found: Can't resolve 'fast-check' #769

Closed duc-hoang-161 closed 3 months ago

duc-hoang-161 commented 4 months ago

Provide environment information

This is my local
  System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Memory: 233.52 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v20.10.0/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
    pnpm: 8.9.2 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 124.0.6367.79
    Safari: 16.2
  npmPackages:
    @uploadthing/react: 6.5.0 => 6.5.0
    typescript: ^5.4.5 => 5.4.5
    uploadthing: 6.10.0 => 6.10.0

Describe the bug

I encountered a build failure in my project after upgrading uploadthing to the latest version (6.10.0). The build failed on Vercel (yarn@1.22.19), in my Bitbucket pipeline (yarn@4.1.0), and on my local. After reverting to uploadthing@6.9.0 and @uploadthing/react@6.4.4, the build was successful.

Below is the log from with-tailwindcss example. It has the same error.

 ❯ yarn install
yarn install v1.22.21
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
warning "uploadthing > @effect/schema@0.66.8" has unmet peer dependency "fast-check@^3.13.2".
[4/4] πŸ”¨  Building fresh packages...

success Saved lockfile.
✨  Done in 28.36s.
❯ cp .env.example .env
❯ yarn build
yarn run v1.22.21
$ next build
  β–² Next.js 14.2.1
  - Environments: .env

   Creating an optimized production build ...
Failed to compile.

./node_modules/@effect/schema/dist/esm/FastCheck.js
Module not found: Can't resolve 'fast-check'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/@effect/schema/dist/esm/Arbitrary.js
./node_modules/@effect/schema/dist/esm/Schema.js
./node_modules/@uploadthing/shared/dist/index.js
./node_modules/@uploadthing/react/dist/index.js
./src/utils/uploadthing.ts
./src/app/page.tsx

./node_modules/@effect/schema/dist/esm/FastCheck.js
Module not found: Can't resolve 'fast-check'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/@effect/schema/dist/esm/Arbitrary.js
./node_modules/@effect/schema/dist/esm/Schema.js
./node_modules/uploadthing/server/index.js
./src/app/layout.tsx

> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Link to reproduction

https://github.com/pingdotgg/uploadthing/tree/main/examples/with-tailwindcss

To reproduce

Additional information

No response

πŸ‘¨β€πŸ‘§β€πŸ‘¦ Contributing

Code of Conduct

juliusmarminge commented 4 months ago

feels like a bug in yarn tbf

scratch that, we might be missing a peerDep.

duc-hoang-161 commented 3 months ago

I can confirm that the issue has been resolved in the latest version ("uploadthing": "^6.10.1", "@uploadthing/react": "^6.5.1")