payloadcms / payloadcms/payload

[ReferenceError: File is not defined]

Open Beginner friendly
#16,138 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale status: needs-triage
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

Hi, I just deployed my payload app with docker and the docker image has been successfully deployed.
But when I was accessing my app it threw an error like this:

[ReferenceError: File is not defined]
 ⨯ unhandledRejection: [ReferenceError: File is not defined]
 ⨯ unhandledRejection:  [ReferenceError: File is not defined]

I found related issue in next's repository https://github.com/vercel/next.js/discussions/56032 and the solution is by upgrading node version to v20, and after I implement this solution my app is running successfully without the error above.

Do you have plan to upgrade node version in Dockerfile and docker-compose.yaml?

Note:
I also tested my app in local by using node 18, and it threw an error same as i faced in docker

Link to the code that reproduces this issue

https://github.com/vercel/next.js/discussions/56032

Reproduction Steps
services:
  payload:
    + image:node:20-alpine
    - image:node:18-alpine
Which area(s) are affected?

Not sure

Environment Info
Binaries:
  Node: 18.20.8
  npm: 10.8.2
  Yarn: 4.9.1
  pnpm: 10.33.0
Relevant Packages:
  payload: 3.78.0
  next: 15.2.9
  @payloadcms/db-postgres: 3.78.0
  @payloadcms/next: 3.78.0
  @payloadcms/richtext-lexical: 3.78.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: Linux fedora 6.19.8-100.fc42.x86_6
  Arch: x64
  Version: Linux fedora 6.19.8
  Available memory (MB): 18120
  Available CPU cores: 12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the Node image versions in the Dockerfile and docker-compose.yaml, then compare them with the reported Node 18 environment and the proposed Node 20 image. Update the deployment configuration if appropriate and verify that the app starts without the ReferenceError when run through Docker.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, node.js
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.