Skip to content
Discussion options

You must be logged in to vote

I had a similar setup (Next.js app in docs/ + Yarn workspaces packages). A couple of things helped:

Transpile local workspaces
In docs/next.config.js, make sure your internal packages are transpiled by Next (works with both Turbopack and webpack):

 @type {import('next').NextConfig}
const nextConfig = {
  transpilePackages: ['package-a', 'package-b'], // your workspace packages
  // If you fall back to webpack:
  experimental: { esmExternals: 'loose' }, // optional (webpack-only)
};
module.exports = nextConfig;

This tells Next to bundle/transform your internal packages (replaces next-transpile-modules).
Docs: Next.js transpilePackages.
Next.js

ESM externals & find-up
find-up is ESM-only in…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@snebjorn
Comment options

Answer selected by snebjorn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants