Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On nx 15.8.7 can't build Next app (13.1.6 nor 13.2.4) #15794

Closed
Tirke opened this issue Mar 21, 2023 · 26 comments
Closed

On nx 15.8.7 can't build Next app (13.1.6 nor 13.2.4) #15794

Tirke opened this issue Mar 21, 2023 · 26 comments
Labels

Comments

@Tirke
Copy link

Tirke commented Mar 21, 2023

Current Behavior

I can no longer build my Nextjs app with nx 15.8.7. I guess it's related to previous issues reported in the Nextjs repo and this PR #15650.

Expected Behavior

I can build the app.

GitHub Repo

No response

Steps to Reproduce

May provide a repro later if I have time.

Nx Report

❯ pnx report
>  NX  Falling back to ts-node for local typescript execution. This may be a little slower.
  - To fix this, ensure @swc-node/register and @swc/core have been installed

 >  NX   Report complete - copy this into the issue template

   Node : 18.14.2
   OS   : darwin arm64
   pnpm : 7.29.0

   nx                      : 15.8.7
   @nrwl/js                : 15.8.7
   @nrwl/jest              : 15.8.7
   @nrwl/linter            : 15.8.7
   @nrwl/workspace         : 15.8.7
   @nrwl/cli               : 15.8.7
   @nrwl/cypress           : 15.8.7
   @nrwl/devkit            : 15.8.7
   @nrwl/esbuild           : 15.8.7
   @nrwl/eslint-plugin-nx  : 15.8.7
   @nrwl/nest              : 15.8.7
   @nrwl/next              : 15.8.7
   @nrwl/node              : 15.8.7
   @nrwl/react             : 15.8.7
   @nrwl/rollup            : 15.8.7
   @nrwl/storybook         : 15.8.7
   @nrwl/tao               : 15.8.7
   @nrwl/web               : 15.8.7
   @nrwl/webpack           : 15.8.7
   @nrwl/nx-cloud          : 15.2.3
   typescript              : 4.9.5

Failure Logs

pnx run front-legacy:build --skip-nx-cache

 >  NX   --skip-nx-cache disables the connection to Nx Cloud for the current run.

   The remote cache will not be read from or written to during this run.


> nx run front-legacy:build:production


./src/components/epic/app-worker/onboarding/specialties/hooks/useSpecialtiesNavigation.ts
62:14  Warning: 'i18n' is assigned a value but never used.  @typescript-eslint/no-unused-vars

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info  - Linting and checking validity of types
info  - Creating an optimized production build
Failed to compile.

../../../libs/common/translation/src/lib/locale.ts
Module parse failed: Unexpected token (2:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| /** i.e.: Europe/Paris */
> export type Timezone = string
| export type Locale = 'en' | 'fr' | 'es' | 'de'
|

Import trace for requested module:
../../../libs/common/translation/src/lib/locale.ts
../../../libs/common/translation/src/index.ts
./src/components/epic/app-worker/profile/details/personal-information/hooks/usePersonalInformation.ts
./src/components/epic/app-worker/profile/details/personal-information/PersonalInformation.tsx

../../../libs/front/api/src/logic/axios/auth/clearCookies.ts
Module parse failed: Unexpected token (1:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> import type { FrontLegacyRuntimeConfig } from '@front/runtime-config'
| import { getRuntimeConfig } from '@front/runtime-config'
| import type { UserType } from '@front/type/auth'

Import trace for requested module:
../../../libs/front/api/src/logic/axios/auth/clearCookies.ts
../../../libs/front/api/src/logic/index.ts
./src/components/epic/app-worker/shared/worker-app-page/WorkerAppPage.tsx

../../../libs/front/api/src/logic/axios/auth/logoutUser.ts
Module parse failed: Unexpected token (4:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| import { segmentReset } from '@front/logic/segment'
> import type { FrontLegacyRuntimeConfig } from '@front/runtime-config'
| import { getRuntimeConfig } from '@front/runtime-config'
| import type { UserType } from '@front/type/auth'

Import trace for requested module:
../../../libs/front/api/src/logic/axios/auth/logoutUser.ts
../../../libs/front/api/src/logic/index.ts
./src/components/epic/app-worker/shared/worker-app-page/WorkerAppPage.tsx

../../../libs/front/api/src/logic/react-query/queryClient.ts
Module parse failed: Unexpected token (2:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { QueryClient } from '@tanstack/react-query'
> import type { AxiosError } from 'axios'
|
| export const queryClient = new QueryClient({

Import trace for requested module:
../../../libs/front/api/src/logic/react-query/queryClient.ts
./src/components/epic/app-admin/shared/admin-app-page/AdminAppPage.tsx

../../../libs/front/api/src/others/google-maps/useGoogleGeocode.ts
Module parse failed: Unexpected token (1:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> import type { UseQueryOptions } from '@tanstack/react-query'
| import { useQuery } from '@tanstack/react-query'
|

Import trace for requested module:
../../../libs/front/api/src/others/google-maps/useGoogleGeocode.ts
../../../libs/front/api/src/others/google-maps/index.ts
../../../libs/front/api/src/others/index.ts
./src/components/epic/app-worker/shared/worker-app-page/WorkerAuthGuard.tsx
./src/components/epic/app-worker/shared/worker-app-page/WorkerAppPage.tsx

Additional Information

No response

@AgentEnder AgentEnder added the scope: nextjs Issues related to NextJS support for Nx label Mar 21, 2023
@hoffination
Copy link

Having the same challenge on my end. Been trying to reproduce it in a fresh application. Noted my details here on #15214 (comment)

@enk0de
Copy link

enk0de commented Mar 23, 2023

When will this issue be resolved? This issue is very critical and is impacting our development.

@wescopeland
Copy link

wescopeland commented Mar 23, 2023

We have used Nx in our organization for roughly a year. The ongoing issues with Next.js honestly have us reconsidering if Nx is the right choice for our organization moving forward.

Today we attempted to upgrade Nx to 15.8.7. Our next.config.js file has the following:

  eslint: {
    ignoreDuringBuilds: true
  },

Yet, ESLint rules are now running on our build. In other words, values in our next.config.js are either being overridden or ignored. I am unclear how something this critical couldn't be caught in peer review.

It seems that Next.js support was stable for quite some time, but is now an afterthought.

@jaysoo
Copy link
Member

jaysoo commented Mar 23, 2023

We're releasing a patch for this, which should land today. Sorry for the inconvenience. There are additional e2e tests to cover these cases as well.

@jaysoo
Copy link
Member

jaysoo commented Mar 23, 2023

Fixed in 15.8.8.

@hoffination
Copy link

The original issue persists on my end still in 15.8.8 but appreciate the review

@jaysoo
Copy link
Member

jaysoo commented Mar 24, 2023

@hoffination Can you share your next config, or maybe a repo to reproduce the error?

@jaysoo
Copy link
Member

jaysoo commented Mar 24, 2023

Here is the new repo using latest Nx. https://github.com/jaysoo/issue-15794

If anyone still has issues please let me know. A reproduction repo would be helpful.

@serjdev
Copy link

serjdev commented Mar 24, 2023

I still have issue when trying to migrate from 13.9.6

npx nx migrate 15.8.8
npx nx migrate --run-migrations

Module parse failed: The keyword 'interface' is reserved (12:0)
File was processed with these loaders:
 * ../../../node_modules/next-translate/lib/cjs/plugin/loader.js
 

@charleskoehl
Copy link

charleskoehl commented Mar 25, 2023

I have had this issue ever since upgrading from 15.8.5 to any later version including 15.8.6.

nx build can no longer recognize typescript in ts or tsx files:

downgrading to 15.8.5 always fixes it.

Here is how I run the migrate from 15.8.5 to 15.8.9:

nx migrate 15.8.9
rm -rf node_modules
yarn
nx build proj1 --skip-nx-cache

Here's a portion of the build errors showing how it can't parse a typescript file:

info  - Linting and checking validity of types
info  - Creating an optimized production build
       Failed to compile.

       ../../libs/booking/data-access/instant-roofer-api-client/src/lib/booking-data-access-instant-roofer-api-client.ts
       Module parse failed: The keyword 'interface' is reserved (8:0)
       You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
       | import { ContractorCandidates } from '../../../../../../types/entities/lead'
       |
       > interface GetContractorCandidatesForLeadRes {
       |   candidates: ContractorCandidates
       |   countyData: {

       Import trace for requested module:
       ../../libs/booking/data-access/instant-roofer-api-client/src/lib/booking-data-access-instant-roofer-api-client.ts
       ../../libs/booking/data-access/instant-roofer-api-client/src/index.ts

The nx report after upgrading to 15.8.9:

nx report

 >  NX   Report complete - copy this into the issue template

   Node : 18.14.1
   OS   : darwin arm64
   yarn : 1.22.19

   nx                      : 15.8.9
   @nrwl/js                : 15.9.0-beta.11
   @nrwl/jest              : 15.9.0-beta.11
   @nrwl/linter            : 15.9.0-beta.11
   @nrwl/workspace         : 15.9.0-beta.11
   @nrwl/cli               : 15.9.0-beta.11
   @nrwl/cypress           : 15.9.0-beta.11
   @nrwl/devkit            : 15.9.0-beta.11
   @nrwl/eslint-plugin-nx  : 15.9.0-beta.11
   @nrwl/express           : 15.9.0-beta.11
   @nrwl/next              : 15.9.0-beta.11
   @nrwl/node              : 15.9.0-beta.11
   @nrwl/react             : 15.9.0-beta.11
   @nrwl/tao               : 15.8.9
   @nrwl/web               : 15.9.0-beta.11
   @nrwl/webpack           : 15.9.0-beta.11
   @nrwl/nx-cloud          : 15.3.2
   typescript              : 4.9.5
   ---------------------------------------
   The following packages should match the installed version of nx
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]
     - @nrwl/[email protected]

   To fix this, run `nx migrate [email protected]`

Running nx migrate [email protected] does not fix the issue.

@jaysoo
Copy link
Member

jaysoo commented Mar 27, 2023

I'll try a few things locally to see if I can reproduce it.

@jaysoo
Copy link
Member

jaysoo commented Mar 27, 2023

I could not reproduce with a fresh Nx 14.8.8 repo that I migrated to 15.8.9. I'm guessing the issue is next.config.js since we had to change they return type for withNx plugin function. It used to return a config object, but now it returns a function (so we can access Next.js phases).

This fresh config works:

//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withNx } = require('@nrwl/next/plugins/with-nx');

/**
 * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  nx: {
    // Set this to true if you would like to to use SVGR
    // See: https://github.com/gregberge/svgr
    svgr: false,
  },
};

module.exports = withNx(nextConfig);

But if you tried to compose plugins by calling withNx(...) and using the returned value as a config it will no longer work.

// This won't work since `withNx` returns a function
const configWithNx = withNx({});
module.exports = {
  ...configWIthNx,
  //...
}

// This will work since we are passing the phase down
const configWithNx = withNx({});
module.exports = async (...args) => {
  return {
    ...(await configWithNx(...args))
    //...
  }
};

Also, do not use next-compose-plugins. It hasn't been updated in years, and does not support the updated config definitions.


If you are running into issues, please share the next config so I can see if there's anything that needs to be updated.

Update: Added async-await to the code snippet since it was missing.

@arendjantetteroo
Copy link

arendjantetteroo commented Mar 27, 2023

We do something like the following:

const { withNx } = require('@nrwl/next/plugins/with-nx');
const { withSentryConfig } = require('@sentry/nextjs');


const plugins = [];

if (process.env.ANALYZE === 'true') {
  // only load dependency if env `ANALYZE` was set
  const withBundleAnalyzer = require('@next/bundle-analyzer')({
    enabled: true
  });

  plugins.push(withBundleAnalyzer);
}


/**
 * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  nx: {
    // Set this to true if you would like to use SVGR
    // See: https://github.com/gregberge/svgr
    svgr: false
  },
  // Compile monorepo libraries with swc as well on nx build pwa
  transpilePackages: ['libs'],
  output: 'standalone',
  experimental: {
    outputFileTracingRoot: path.join(__dirname, '../../')
  }
};

// ... Some ifs for dev/prod builds not needing sentry setup
nextConfig.sentry = {
    disableServerWebpackPlugin: true,
    disableClientWebpackPlugin: true
  };

const SentryWebpackPluginOptions = {
  silent: true // Suppresses all logs
};

module.exports = withSentryConfig(
  withNx(plugins.reduce((acc, next) => next(acc), nextConfig)),
  SentryWebpackPluginOptions
);

Given your explanation this is no longer possible given that it returns a function now. Moving withNx outside withSentryConfig fixes it, but then i think the sourcemaps stuff is probably off (have not verified this yet, but sentry says to put their withSentryConfig as most outside as possible).

I'll try with the ... operator and see if that works properly.

Btw, is this transpilePackages: ['libs'], needed or should nx handle that for us? (i tried with buildable libs with swc and the standard nx generate next:libs setup. Both didn't work without this transpilePackages setup, not sure if that's related?

@jaysoo i tried this but am unsure where to put the plugins reduce function result

const config = plugins.reduce((acc, next) => next(acc), nextConfig);
const configWithNx = withNx({});

module.exports = (...args) => {
  const nxConfig = configWithNx(...args);
  return withSentryConfig(
    nxConfig,
    SentryWebpackPluginOptions
  );
};

@jaysoo
Copy link
Member

jaysoo commented Mar 27, 2023

Btw, is this transpilePackages: ['libs'], needed or should nx handle that for us?

This isn't needed to use workspace libs, with or without buildable libraries.

Something like this should work with Sentry:

module.exports = async (phase, context) => {
  let updatedConfig = plugins.reduce((acc, fn) => fn(acc), nextConfig);
  updatedConfig = await withNx(updatedConfig)(phase, context);
  updatedConfig = withSentryConfig(updatedConfig, SentryWebpackPluginOptions);
  return updatedConfig;
}

We may need to expose a composePlugins function to make it easier to work with different plugins now that next-compose-plugins isn't working.

@serjdev
Copy link

serjdev commented Mar 27, 2023

@charleskoehl thanks, at least now I was able to migrate from 13.8.6 to 15.8.5 :)

next step will be to align it to the latest, but I run now into your problem as well,

@jaysoo
Copy link
Member

jaysoo commented Mar 27, 2023

@Serj10GR Make sure if you are using the return from withNx it is being awaited on, see the example I posted above.

@charleskoehl
Copy link

I could not reproduce with a fresh Nx 14.8.8 repo that I migrated to 15.8.9. I'm guessing the issue is next.config.js since we had to change they return type for withNx plugin function. It used to return a config object, but now it returns a function (so we can access Next.js phases).
...

Thanks @jaysoo. I am indeed using next-compose-plugins:

//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const withPlugins = require('next-compose-plugins')
const { withNx } = require('@nrwl/next/plugins/with-nx')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
})

const intercept = require('intercept-stdout')

// safely ignore recoil warning messages in dev (triggered by HMR)
function interceptStdout(text) {
  if (text.includes('Duplicate atom key')) return ''
  return text
}

if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'development') {
  intercept(interceptStdout)
}

const nextConfig = {
  productionBrowserSourceMaps: false,
  experimental: {
    allowMiddlewareResponseBody: true,
  },
}

module.exports = async (phase, { defaultConfig }) =>
  withPlugins([withNx, withBundleAnalyzer], nextConfig)(phase, {
    ...defaultConfig,
    ...nextConfig,
  })

I removed the bundle analyzer and rewrote next.config.js below.

//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withNx } = require('@nrwl/next/plugins/with-nx')

const intercept = require('intercept-stdout')

// safely ignore recoil warning messages in dev (triggered by HMR)
function interceptStdout(text) {
  if (text.includes('Duplicate atom key')) return ''
  return text
}

if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'development') {
  intercept(interceptStdout)
}

const nextConfig = {
  productionBrowserSourceMaps: false,
}

module.exports = withNx(nextConfig)

Now I am able to migrate to 15.8.9 and build all apps.

@arendjantetteroo
Copy link

module.exports = async (phase, context) => {
  let updatedConfig = plugins.reduce((acc, fn) => fn(acc), nextConfig);
  updatedConfig = await withNx(updatedConfig)(phase, context);
  updatedConfig = withSentryConfig(updatedConfig, SentryWebpackPluginOptions);
  return updatedConfig;
}

Thanks! This snippet almost works, except that the withNx doesn't accept a context argument, just a phase.
updatedConfig = await withNx(updatedConfig)(phase);

Works for me with both 13.1.6 and with 13.2.4 locally, thank you!

@serjdev
Copy link

serjdev commented Mar 28, 2023

@Serj10GR Make sure if you are using the return from withNx it is being awaited on, see the example I posted above.

still have problems with it :(

this is my next.config

const { withNx } = require('@nrwl/next/plugins/with-nx');
const nextTranslate = require('next-translate');
const { withSentryConfig } = require('@sentry/nextjs');

module.exports = async (phase, context) => {
  const isProd = process.env.NODE_ENV === 'production';
  const assetPrefix = (isProd && phase !== '') ? phase: undefined;
  const buildId = isProd ? `${assetPrefix.substring(1).replaceAll('/', '-')}` : '';

    const plugins = [
      withNx,
      nextTranslate,
      withSentryConfig,
    ];

    let updatedConfig = plugins.reduce((acc, next) => next(acc), {
      assetPrefix,
      generateBuildId: async () => buildId,
      poweredByHeader: false,
      publicRuntimeConfig: {
        assetPrefix,
      },
      trailingSlash: true,
      sentry: {
        hideSourceMaps: true,
      },
    });

    updatedConfig = await withNx(updatedConfig, context);
    updatedConfig = await nextTranslate(updatedConfig, context);
    updatedConfig = await withSentryConfig(updatedConfig, SentryWebpackPluginOptions);

    return updatedConfig;
};

@jaysoo
Copy link
Member

jaysoo commented Mar 28, 2023

@Serj10GR You'll need to remove withNx and withSentryConfig from the plugins array. I think it's better for now to just call each plugin manually.

const { withNx } = require('@nrwl/next/plugins/with-nx');
const nextTranslate = require('next-translate');
const { withSentryConfig } = require('@sentry/nextjs');

module.exports = async (phase, context) => {
  const isProd = process.env.NODE_ENV === 'production';
  const assetPrefix = (isProd && phase !== '') ? phase: undefined;
  const buildId = isProd ? `${assetPrefix.substring(1).replaceAll('/', '-')}` : '';

    const addNx = withNx({
      assetPrefix,
      generateBuildId: async () => buildId,
      poweredByHeader: false,
      publicRuntimeConfig: {
        assetPrefix,
      },
      trailingSlash: true,
      sentry: {
        hideSourceMaps: true,
      },
    });

    let config = await addNx(phase);
    config = await nextTranslate(config);
    config = await withSentryConfig(config, SentryWebpackPluginOptions);

    return config;
};

@jaysoo
Copy link
Member

jaysoo commented Mar 28, 2023

I will close this issue since the original problem is fixed.

@jaysoo jaysoo closed this as completed Mar 28, 2023
@hoffination
Copy link

Thanks for figuring out what was going on @jaysoo !

I'm still having a few issues as I'm not sure how to both configure webpack and run this async:

// Generating custom buildId based off of the commit hash for multi-server support
const { execSync } = require('child_process')
const buildId = execSync('git rev-parse HEAD').toString().trim()

// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNx = require('@nrwl/next/plugins/with-nx')
const nextTranslate = require('next-translate-plugin')

/**
 * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  nx: {
    // Set this to true if you would like to to use SVGR
    // See: https://github.com/gregberge/svgr
    svgr: true,
  },
  compiler: {
    reactRemoveProperties: { properties: ['^data-testid$'] },
  },
}

const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
})

// We need to grab the existing webpack export here and overwrite/call it below.
// If we don't do this, the original one is simply overwritten and we lose any
// existing webpack configuration.
const nxExports = withBundleAnalyzer(withNx(nextTranslate(nextConfig)))
const nxWebpack = nxExports.webpack

const HOME = '/home'

const moduleExports = {
  productionBrowserSourceMaps: true,
  ...nxExports,
  generateBuildId: async () => buildId,
  webpack: (config, options) => {
    config.module.rules.push({
      test: /\.(graphql|gql)$/,
      exclude: /node_modules/,
      loader: 'graphql-tag/loader',
    })
    config.module.rules.push({
      test: [/libs\/(api|geolocation|modules|ui|utils)\/.*\/(index|graphql).ts/i],
      sideEffects: false,
    })

    // Make sure to call the original webpack config so that we keep any existing configuration.
    return nxWebpack(config, options)
  },

  images: {
    domains: ['res.cloudinary.com', 'www.gravatar.com'],
  },

  //
  // https://nextjs.org/docs/api-reference/next.config.js/redirects
  //
  async redirects() {
    return [
      { source: '/users', destination: HOME, permanent: true },
      { source: '/users/verify', destination: HOME, permanent: true },
      { source: '/users/reset-password', destination: HOME, permanent: true },

      process.env.NEXT_PUBLIC_FEATURE_3D !== 'true'
        ? { source: '/:listing/:id/3d', destination: HOME, permanent: false }
        : undefined,
    ].filter(Boolean)
  },

  async rewrites() {
    return [
      {
        source: '/',
        destination: HOME,
      },
    ]
  },

  // Only ".tsx" are consider valid pages
  pageExtensions: ['tsx'],
  compress: process.env.NO_COMPRESS !== 'true',

  async headers() {
    return [
      {
        source: '/:all*(svg|jpg|png|woff|woff2)',
        headers: [
          {
            key: 'Cache-Control',
            value: 'public, max-age=31536000, immutable',
          },
        ],
      },
      {
        source: '/:path*',
        headers: [
          {
            key: 'Vary',
            value: 'User-Agent',
          },
        ],
      },
    ]
  },
}

module.exports = moduleExports

@SergiuGrisca
Copy link

@jaysoo your last config works locally ok, but after the build is done we have an error when trying to start

TypeError: Cannot read properties of undefined (reading 'data')
    at getTargetConfig (/node_modules/@nrwl/next/plugins/with-nx.js:31:24)
    at getNxContext (/node_modules/@nrwl/next/plugins/with-nx.js:42:26)
    at /node_modules/@nrwl/next/plugins/with-nx.js:104:106
    at Generator.next (<anonymous>)

any idea on this ?

@jaysoo
Copy link
Member

jaysoo commented Apr 13, 2023

@SergiuGrisca Hmm. Is that starting with nx serve? It looks like the nx graph isn't being found for a project. Try running nx reset and if that doesn't help let me know.

@burakkgunduzz
Copy link

Btw, is this transpilePackages: ['libs'], needed or should nx handle that for us?

This isn't needed to use workspace libs, with or without buildable libraries.

Something like this should work with Sentry:

module.exports = async (phase, context) => {
  let updatedConfig = plugins.reduce((acc, fn) => fn(acc), nextConfig);
  updatedConfig = await withNx(updatedConfig)(phase, context);
  updatedConfig = withSentryConfig(updatedConfig, SentryWebpackPluginOptions);
  return updatedConfig;
}

We may need to expose a composePlugins function to make it easier to work with different plugins now that next-compose-plugins isn't working.

Hey @jaysoo I saw a commit about it but could not be sure. Did you expose composePlugins function, can we use it now? If you did, is there any api docs about it?

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests