Next.js Discord

Discord Forum

Issues with symlinks when using --turbo flag

Unanswered
Wirehaired Pointing Griffon posted this in #help-forum
Open in Discord
Wirehaired Pointing GriffonOP
Hi, I have a next.js project that shares a drizzle db schema with an external service. The next.js backend needs to access the db, while at the same time the external backend needs to and they share the same schema(for now)
I have the schema symlinked, and it works fine without the turbo flag but with the --turbo flag it can't resolve the path. From my understanding I want to avoid turbopack building anything schema related at all because its server only so I've tried both "use server" and import "server-only" in the local file that imports the schema from symlink, but nothing works.

2 Replies

Wirehaired Pointing GriffonOP
I'm also open to any suggestions on how to change my structure. Right now the application is in development and I am the sole developer, so for me its much more valuable to have instant changes with a single source of truth across my repos. I know a more correct way of doing this might be to use an internal npm package, and I have done that before, but I found that the constant republishing and then updating really slowed down development
Thanks 🙂