-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Problems with Next and internal libs #30714
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
Comments
Out of curiosity: have you tried rspack? |
can confirm, I'm running into the same issue |
Any update or workaround for this? 👀 |
@mj-meyer did you find a solution for this?... |
Hi @ndcunningham, did you was able to take a look at this?... At the end also occurs in Next 15.2 too, not in Next 15.3 :( |
Hey, I took a look and the problem here is Next.js by default doesn't support esm libs extensions import as A workaround is to just change your library export from const nextConfig = {
webpack: (config) => {
config.resolve.extensionAlias = {
'.js': ['.js', '.ts', '.tsx'],
};
return config;
},
nx: {
// Set this to true if you would like to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
}; A fix is coming shortly! |
@ndcunningham there is something else happening... If you create a lib, publish the package, and install the package in a new next app in another Nx workspace or created with The problem is the Removing that line make the library works in external next apps |
@gperdomor can you create a new issue for this so that it can be tracked? |
@ndcunningham this is the new issue #31332 to track the new cases, let me know if you need something else 🙏🏻 |
After looking further into this I think there are two issues related to both Webpack and Turbopack. I think that this issue is related to turbopack as the configuration should be the same as webpack. |
Uh oh!
There was an error while loading. Please reload this page.
Current Behavior
You can't use internal workspace libs in your next apps... The packages are not resolved
Expected Behavior
The apps should works as expected...
GitHub Repo
https://github.com/gperdomor/nx-next-issue
Steps to Reproduce
Update next to latest 15.3.0 version (also in package.json from the app folder)Run the app again and open a page... Make sure that runs with next 15.3.0, if not please remove .next folder and node_modules inside your app folder.Nx Report
Failure Logs
Package Manager Version
npm 11.3.0
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: