-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Remix doesn't split server code #6318
Comments
It might be related: #6302 |
Related to #6259 |
To get rid of the Also, since you don't have a build step, you'll probably want Remix to bundle your service package. To do that you can configure When you define routes outside of your remix app package:
|
@joejemmely thanks, that get's indeed rid of the Returning to |
Not a perfect solution but if you re-export the library from a |
This is not a solution in the context of this issue (monorepo), and just used the expected behavior of server only code when importing from |
We just published version |
This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that are unactionable. Please reach out if you have more information for us! 🙂 |
What version of Remix are you using?
1.16.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Repository: https://github.com/jaschaio/remix-monorepo
Manual steps to reproduce:
Create a new directory and enter it:
Run
create-remix@latest
:Choose
app
,Just the basics
,Remix App Server
,TypeScript
andYes
:Create another subdirectory within the
remix-monorepo/packages
folder with two files:remix-monorepo/packages/package.json
remix-monorepo/packages/User.ts
Fill the
remix-monorepo/packages/package.json
:Fill the
remix-monorepo/packages/User.ts
:Add the
services
module as a dependency to the remix projectEdit the
app/app/root.tsx
file:Run
npm run dev
:Expected Behavior
Remix should strip server only code from client bundles and not throw any errors when trying to bundle node dependencies like
crypto
.Actual Behavior
Remix throws errors:
I get it as well with other build in node modules:
Just a handful of things that throw errors for me:
The text was updated successfully, but these errors were encountered: