npm run build in Nextjs application causing an unexpected error which is not occuring on local machine or else
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
Description
Describe the bug
A clear and concise description of what the bug is.
Next.js build error occurred which is not occurring on gitlab ci pipeline
While developing an application for my client I had used github actions to build and deploy it on AWS beanstalk later
I have developed a minimal static landing page and changed the the favicon.ico as with their requested favicon.ico but noticed it's failing on github actions all of the npm run build command
logs has given below
I had ran the command npm run build locally and it ran successfully without any issue
my local machine is running on ubuntu latest
and on github actions pipeline i am also using ubuntu latest
for clearing my doubt I had spawn up a gitlab ci pipeline on gitlab and ran the same tests with same configurations and it ran successfully
I don't know what is going on with github actions
please check and fix the issue
I can assure you that there is no syntax error in the pipeline where I am trying to run the build configuration
To Reproduce
Steps to reproduce the behavior:
- install latest nextjs using command npx-create-next-app (press enter) go with all of the prompts
- Run : - npm run build after changing the default favicon.ico
- See error
Expected behavior
A clear and concise description of what you expected to happen.
After ran npm run build it should able to run successfully and should able to successfully build and store the build files into artifacts
Runner Version and Platform
Version of your runner?
github hosted runner : might be latest
OS of the machine running the runner? OSX/Windows/Linux/...
Ubuntu linux latest
What's not working?
Please include error messages and screenshots.
Job Log Output
If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.
Runner and Worker's Diagnostic Logs
If applicable, add relevant diagnostic log information. Logs are located in the runner's _diag folder. The runner logs are prefixed with Runner_ and the worker logs are prefixed with Worker_. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.
- npm WARN exec The following package was not found and will be installed: next@13.4.13
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
Next.js Telemetry
Status: Enabled
Next.js telemetry is completely anonymous. Thank you for participating!
Learn more: https://nextjs.org/telemetry
Your preference has been saved to /home/runner/work/threads_clone/threads_clone/cache/config.json.
Status: Disabled
You have opted-out of Next.js' anonymous telemetry program.
No data will be collected from your machine.
Learn more: https://nextjs.org/telemetry
added 413 packages, and audited 414 packages in 10s
111 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
Next.js Telemetry
Status: Disabled
You have opted-out of Next.js' anonymous telemetry program.
No data will be collected from your machine.
Learn more: https://nextjs.org/telemetry
Next.js' telemetry collection is already disabled.
Status: Disabled
You have opted-out of Next.js' anonymous telemetry program.
No data will be collected from your machine.
Learn more: https://nextjs.org/telemetry
threads_clone@0.1.0 build
next build
-
warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry -
info Creating an optimized production build...
Failed to compile.
next-app-loader?page=%2F(root)%2Fpage&name=app%2F(root)%2Fpage&pagePath=private-next-app-dir%2F(root)%2Fpage.tsx&appDir=%2Fhome%2Frunner%2Fwork%2Fthreads_clone%2Fthreads_clone%2Fapp&appPaths=%2F(root)%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!:21
Error: Image import "next-metadata-image-loader?type=favicon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/home/runner/work/threads_clone/threads_clone/app/favicon.ico?next_metadata" is not a valid image file. The image may be corrupted or an unsupported format.
Build failed because of webpack errors
Error: Process completed with exit code 1.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the GitHub Actions workflow and the supplied npm run build log, especially the Next.js favicon error, then compare the runner setup with the local and GitLab CI configurations. Done requires a reproducible runner-side failure or a clearly identified reason the issue is not caused by the runner application.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, next.js, ubuntu
- Domain
- build-system, ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100