turbo: pnpm/nextjs build hangs again if next outputStandalone is used

What version of Turborepo are you using?

1.3.1

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

Turbo hangs on next build, if pnpm and next outputStandalone is used. The output shows the turbo build summary, but the process never ends.

The bug was introduced with version 1.2.6, fixed in 1.2.12 (#1265) and reintroduced in 1.3.0.

I’ve updated the repository (https://github.com/sdorra/turbo-next-standalone-issue) to turbo 1.3.1.

Expected Behavior

The build process ends.

To Reproduce

git clone https://github.com/sdorra/turbo-next-standalone-issue
cd turbo-next-standalone-issue
pnpm install
pnpm run build

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Apologies @baptisteArno, this one slipped through the cracks. Can you test this again with the latest turbo canary? We recently fixed an issue (#1719) related to hanging when using next in standalone mode.

Great!!! Using "turbo": "1.4.4-canary.0" build not hangs anymore

I have the exact same issue with next@12.2.4, turbo@1.4.2 and pnpm@7.8.0.

@tknickman please reopen 😃

I have the same issue when using pnpm, worked fine with yarn.

next@12.2.3, turbo@1.4.2 and pnpm@7.8.0 = ❗fail (hangs after showing build summary) next@12.2.3, turbo@1.2.16 and pnpm@7.8.0 = ✅ success

my next.config.js:

/** @type {import('next').NextConfig} */
const path = require('path');
const { withSentryConfig } = require('@sentry/nextjs');

const nextConfig = {
  images: {
    domains: ['cdn.sanity.io'],
  },
  i18n: {
    locales: ['nb'],
    defaultLocale: 'nb',
    localeDetection: false,
  },
  compiler: {
    styledComponents: true,
  },
  reactStrictMode: true,
  output: 'standalone',
  experimental: {
    outputFileTracingRoot: path.join(__dirname, '../../'),
  },
}

const SentryWebpackPluginOptions = {
  dryRun: process.env.SENTRY_AUTH_TOKEN ? false : true,
  silent: true,
  finalize: false,
};

const withTM = require('next-transpile-modules')([]);

module.exports = withSentryConfig(withTM(nextConfig), SentryWebpackPluginOptions);

Apologies @baptisteArno, this one slipped through the cracks. Can you test this again with the latest turbo canary? We recently fixed an issue (https://github.com/vercel/turborepo/issues/1719) related to hanging when using next in standalone mode.

@tknickman the option is experimental in next.js 12.1.6. Moving the option outside the experimental object fixes the issue, because it disables the standalone output.

I’ve updated the sample repo to the latest next.js version (12.2.2) and updated the configuration. The issue still exists.

It seems that i’ve not privileged to reopen the issue.