Skip to content
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

Root route imports are always bundled for edge #106

Open
DuncanLHS opened this issue Apr 22, 2024 · 1 comment
Open

Root route imports are always bundled for edge #106

DuncanLHS opened this issue Apr 22, 2024 · 1 comment

Comments

@DuncanLHS
Copy link

As a result of issues with unsupported modules similar to #94 and #104 (in my case the problem is tailwind-merge) I've been trying to avoid edge and have everything run in node for the time being. However, as soon as I start adding UI to my root file I get the unsupported module errors back again due to the tailwind-merge module.

It looks like everything in root.tsx is being bundled for the edge runtime. adding export const config = { runtime: "nodejs" } to root.tsx has no impact and is ignored.

Is this intended default behaviour? How to get around it?

@TooTallNate
Copy link
Member

The root layout is indeed included for all leaf routes. If you have some common layout which is using modules that are not supported on Edge runtime, consider defining a pathless layout which has export const config = { runtime: "nodejs" } and then you could nest any routes which use that layout underneath that pathless layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants