Search code examples
next.jsgitlabgitlab-cipnpmturborepo

Nextjs build in standalone mode hangs with Turborepo (> v1.2.6) and not exit from Gitlab CI pipeline task


I have project with a monorepo on pnpm workspaces and turborepo to manage monorepo scripts.

All the single projects works as expected, they are nextjs projects. When i upgraded turborepo from the 1.2.6 to the 1.4.0 version and when i run the build script on a gitlab ci, the build task succeeded, but the pipeline keep stuck.

build output

I run the script in this way on the pipeline

.gitlab-ci.yml

.build-dashboard:
  image: gitlab.****.it:4567/.../node-pnpm
  stage: build
  script:
    - pnpm build:dashboard

package.json

....
scripts: {
    "build:dashboard": "turbo run build --filter=...@project/dashboard && exit 0"
}
...

i try to force the exit using exit 0, but without success (with turobrepo > 1.2.6).

Any suggestions on that ?

Thanks

UPDATE

After many attempt i get an additional log messagge

Attempting to remove file /builds/.../....-user-interface/node_modules/.cache/turbo/a9f0a39c2d3de111/apps/main/.next/standalone/node_modules/.pnpm/supports-color@7.2.0/node_modules/has-flag; a subdirectory is required

Solution

  • As discussed here the problem whas related to turborepo with next build in standalone mode.

    Install "turbo": "1.4.4-canary.0" solve the issue.