Skip to content

Using [email protected] causes build to fail due to nextCssLoader.issuer being undefined #12916

@terrymun

Description

@terrymun

Current Behavior

Running yarn build will fail after upgrading from [email protected] to [email protected].

Expected Behavior

The build process should run without issue: this is a regression because it used to work with [email protected] installed.

Steps to Reproduce

Any routine installation will work, then upgrading the NextJs version to use 13.0.1 will cause the build to fail. The error comes from the with-nx.ts file reliance on the issuer field (https://github.com/nrwl/nx/blob/master/packages/next/plugins/with-nx.ts#L83), which has been removed in [email protected]: https://github.com/vercel/next.js/pull/42106/files

Failure Logs

TypeError: Cannot read properties of undefined (reading 'and')
  at webpack (/[REDACTED_PATH_TO_REPO]/node_modules/@nrwl/next/plugins/with-nx.js:53:64)
  at Object.config.webpack (/[REDACTED_PATH_TO_REPO]/node_modules/@nrwl/next/src/utils/config.js:60:163)
  at Object.getBaseWebpackConfig [as default] (/[REDACTED_PATH_TO_REPO]/node_modules/next/dist/build/webpack-config.js:1402:32)
  at async Promise.all (index 0)
  at async Span.traceAsyncFn (/[REDACTED_PATH_TO_REPO]/node_modules/next/dist/trace/trace.js:79:20)
  at async /[REDACTED_PATH_TO_REPO]/node_modules/next/dist/build/index.js:448:33
  at async /[REDACTED_PATH_TO_REPO]/node_modules/next/dist/build/index.js:433:13
  at async Span.traceAsyncFn (/[REDACTED_PATH_TO_REPO]/node_modules/next/dist/trace/trace.js:79:20)
  at async build (/[REDACTED_PATH_TO_REPO]/node_modules/next/dist/build/index.js:64:29)

Environment

Node : 16.18.0
OS   : darwin x64
yarn : 3.1.1

nx : 15.0.4
@nrwl/angular : Not Found
@nrwl/cypress : 15.0.4
@nrwl/detox : Not Found
@nrwl/devkit : 15.0.4
@nrwl/esbuild : 15.0.4
@nrwl/eslint-plugin-nx : 15.0.4
@nrwl/expo : Not Found
@nrwl/express : Not Found
@nrwl/jest : 15.0.4
@nrwl/js : 15.0.4
@nrwl/linter : 15.0.4
@nrwl/nest : Not Found
@nrwl/next : 15.0.4
@nrwl/node : 15.0.4
@nrwl/nx-cloud : 15.0.0
@nrwl/nx-plugin : Not Found
@nrwl/react : 15.0.4
@nrwl/react-native : Not Found
@nrwl/rollup : 15.0.4
@nrwl/schematics : Not Found
@nrwl/storybook : 15.0.4
@nrwl/web : 15.0.4
@nrwl/webpack : 15.0.4
@nrwl/workspace : 15.0.4
typescript : 4.8.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
      lerna: 6.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions