Skip to content

Next.js turbopack bundler seems not to be working out-of-the-box #272

Description

turbopack is the new default bundler since next.js v16: https://nextjs.org/docs/app/api-reference/turbopack#version-changes

Turbopack becomes the default bundler for Next.js. Automatic support for Babel when a configuration file is found.

In the default configuration, it is responsible for deployment errors: Turbopack ignores package.json files when there are directly in the $HOME directory. However it is the case in our build image/process

Thus, it raises the following warning, and fails to build the project

⚠ Warning: Next.js ignored package.json in /build/<uuid> because it would include your home directory (/build/<uuid>).
...
Error: Could not find the Next.js package (next/package.json)
Resolved from: /build/<uuid>/packages/applications/ssr/src/app
Filesystem root used for resolution: /build/<uuid>/packages/applications/ssr

The workaround identified at the moment is to override the HOME env var before executing the build, which is pretty unusual.

"build": "HOME=\"${TMPDIR:-/tmp}/next-build-home\" next build",

Maybe better workaround may be found and properly documented?
Maybe even we could try to support it directly within the buildpack?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions