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

@nrwl/next v15.0.4 withNx cannot add libs path into webpack loaders #12912

Closed
abel1105 opened this issue Nov 1, 2022 · 3 comments
Closed

@nrwl/next v15.0.4 withNx cannot add libs path into webpack loaders #12912

abel1105 opened this issue Nov 1, 2022 · 3 comments
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug

Comments

@abel1105
Copy link
Contributor

abel1105 commented Nov 1, 2022

Current Behavior

When install @nrwl/next v15.0.4 with next v13.0.1, running the serve command will crash with the following error

I think the root cause is next v13.0.1 removed the issuer from the webpack config. (Next.js PR)

Expected Behavior

It should not throw errors when running serve.

Steps to Reproduce

npx create-nx-workspace@latest next-13-demo --preset=next
cd next-13-demo
pnpm install next@latest
pnpm start --verbose

Failure Logs

➜  next-13-demo git:(main) ✗ pnpm start --verbose

> next-13-demo@0.0.0 start /Users/abel/www/next-13-demo
> nx serve "--verbose"


> nx run web-app:serve:development


 >  NX   Cannot read properties of undefined (reading 'and')


TypeError: Cannot read properties of undefined (reading 'and')
    at webpack (/Users/abel/www/next-13-demo/node_modules/.pnpm/@nrwl+next@15.0.4_zrbe3cr7yxpdlpk67wjm3wnrme/node_modules/@nrwl/next/plugins/with-nx.js:53:64)
    at config.webpack (/Users/abel/www/next-13-demo/node_modules/.pnpm/@nrwl+next@15.0.4_zrbe3cr7yxpdlpk67wjm3wnrme/node_modules/@nrwl/next/src/utils/config.js:60:163)
    at Object.getBaseWebpackConfig [as default] (/Users/abel/www/next-13-demo/node_modules/.pnpm/next@13.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/build/webpack-config.js:1402:32)
    at async Promise.all (index 0)
    at async Span.traceAsyncFn (/Users/abel/www/next-13-demo/node_modules/.pnpm/next@13.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/trace/trace.js:79:20)
    at async Span.traceAsyncFn (/Users/abel/www/next-13-demo/node_modules/.pnpm/next@13.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/trace/trace.js:79:20)
    at async HotReloader.start (/Users/abel/www/next-13-demo/node_modules/.pnpm/next@13.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/dev/hot-reloader.js:329:30)
    at async DevServer.prepare (/Users/abel/www/next-13-demo/node_modules/.pnpm/next@13.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/dev/next-dev-server.js:514:9)

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target "web-app:serve" failed

   Failed tasks:

   - web-app:serve:development

   Hint: run the command with --verbose for more details.

 ELIFECYCLE  Command failed with exit code 1.

Environment


   Node : 18.8.0
   OS   : darwin arm64
   pnpm : 7.11.0
   
   nx : 15.0.4
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.0.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.0.4
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.0.4
   @nrwl/expo : Not Found
   @nrwl/express : 15.0.4
   @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 : Not Found
   @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.7.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @nx-aws-plugin/nx-aws-cache: 1.1.0

@mrlonis
Copy link

mrlonis commented Nov 2, 2022

Also experiencing this same issue. v15.0.6 is affected and is the most recent version as of this comment going live

@FrozenPandaz FrozenPandaz added the scope: nextjs Issues related to NextJS support for Nx label Nov 3, 2022
Miikis added a commit to Miikis/nx that referenced this issue Nov 5, 2022
Next.js v13+ removed the 'issuer' field from their css/sass loaders. This breaks the nx-next plugin
'withNx'. This PR just adds a check to ensure the 'issuer' field is still there. Not the most robust
fix but it should at least maintain backwards-compatibility w/ folks using next.js < 13.

ISSUES CLOSED: nrwl#12916, nrwl#12912
@jaysoo
Copy link
Member

jaysoo commented Nov 7, 2022

Merged this PR #12973 which will fix this issue.

@jaysoo jaysoo closed this as completed Nov 7, 2022
@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 Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug
Projects
None yet
Development

No branches or pull requests

4 participants