pingdotgg / uploadthing

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

Uploadthing does not work in production environment for NextJS14.0.2 #499

Closed greyyT closed 9 months ago

greyyT commented 9 months ago

Provide environment information

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 12.40 GB / 19.36 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.5.1 - /usr/bin/node
    npm: 10.1.0 - /usr/bin/npm
    bun: 1.0.3 - /usr/bin/bun
  Browsers:
    Chrome: 119.0.6045.199
  npmPackages:
    @uploadthing/react: ^6.0.2 => 6.0.2
    typescript: ^5 => 5.2.2
    uploadthing: ^6.0.3 => 6.0.3

Describe the bug

I am currently trying to Dockerize my NextJS app. I first tested out the local production by running npm run build && npm run start. I tried out all of my app features and notice that for some reasons, when I uploaded a file, the button kept loading and doesn't do anything.

image

When I checked out the console, the serverCallback response kept returning 'still waiting'.

image

However, when I checked my uploadthing files at https://uploadthing.com/dashboard, it did upload the file to the dashboard, but for some reason in the client, it did not count as uploaded.

Hope you will fix the problem, thanks a lot for reading this.

Link to reproduction

https://github.com/greyyT/discord-clone

To reproduce

To reproduce the bug, create a .env file based on .env.example file.

Run the following commands:

npm install
npx prisma generate
npx prisma db push
npm run build
npm run start

Make sure to have the MySQL running at port 3306.

Additional information

No response

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

Code of Conduct

juliusmarminge commented 9 months ago

You need to use a tunnel to get local builds working as there is no dev hook in production: https://docs.uploadthing.com/faq#youre-testing-a-production-build-locally