-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(nextjs): add workspace dependencies to transpilePackages automatically #16774
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -204,6 +207,22 @@ function withNx( | |||
dependencies = result.dependencies; | |||
} | |||
|
|||
// For Next.js 13.1 and greater, make sure workspace libs are transpiled. | |||
forNextVersion('>=13.1.0', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a util function that will us to support different configuration that are introduced in different Next.js versions.
updatePaths(dependencies, paths); | ||
return paths; | ||
} | ||
|
||
function readPaths(tsConfig: string | ts.ParsedCommandLine) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to ts utils since it's not specific to buildable libs.
3567286
to
198278c
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
There are issues with Next.js not transpiling workspace libraries (i.e. packages with aliases in tsconfig). You can see this problem even without Nx, where you have to manually specify
transpilePackages
if you use aliases.See: https://github.com/jaysoo/next-with-libs/tree/no-nx
This PR adds a feature where we will automatically add those packages for the user since we know they need to be specified anyway.
Note: This only applies if the user is not using the apps/libs setup.
Current Behavior
Expected Behavior
Related Issue(s)
Fixes #16658