Closed kingsleykbc closed 10 months ago
duplicate of https://github.com/nrwl/nx/issues/19555 solution can be found here: https://github.com/nrwl/nx/issues/16658
basically add your package names to next.config.js
=> transpilePackages: ["ui"]
and it will work.
The problem is that the libs are not included into next compiling process and 'use client'
is not compiled
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.
Current Behavior
After updating Next.js to version 13.5.5-canary.19 within our NX monorepo, our project no longer compiles as expected. The issue arises specifically when pages try to import components from shared libraries. We're encountering a module parse failure related to ui-context.tsx and other libs within our shared library. This issue was not present prior to the update.
The application fails to compile, indicating a module parse failure and suggesting the absence of a necessary loader for handling specific file types within our shared libraries.
Expected Behavior
The application compiles successfully, and pages correctly import and render components from shared libraries, without module parse failures.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
npm --9.5.1
Operating System
Additional Information
The issue surfaced after updating to a canary version of Next.js; it was not present when using the stable release. We suspect there could be incompatibilities or required configurations that were introduced in the new version, affecting how modules are parsed and compiled, specifically in a monorepo setting using NX.
Attached is our project’s dependency graph for a visual representation of our setup.