Fallenbagel / jellyseerr

Fork of overseerr for jellyfin support.
https://docs.jellyseerr.dev/
MIT License
3.85k stars 245 forks source link

1.3GiB of production dependencies #1070

Closed jkhsjdhjs closed 1 week ago

jkhsjdhjs commented 1 week ago

Description

When installing jellyseerr (e.g. using the AUR package), the resulting production build contains 1.3GiB of production dependencies after pruning. Before pruning, there are only ~200MiB more.

$ du -sh node_modules
1,5G    node_modules
$ pnpm prune --prod
$ du -sh node_modules
1,3G    node_modules

I think there's something wrong here, as the final production build still has typescript and stuff like @next/swc-linux-x64-musl, which should both be only required to build the package:

$ pnpm why typescript
[...]
dependencies:
connect-typeorm 1.1.4
└─┬ typeorm 0.3.12 peer
  └─┬ ts-node 10.9.1 peer
    └── typescript 4.9.5 peer
react-intl 6.6.8
├─┬ @formatjs/intl 2.10.4
│ └── typescript 4.9.5 peer
└── typescript 4.9.5 peer
typeorm 0.3.12
└─┬ ts-node 10.9.1 peer
  └── typescript 4.9.5 peer
$ pnpm why @next/swc-linux-x64-musl
[...]
dependencies:
next 14.2.4
└── @next/swc-linux-x64-musl 14.2.4

Version

2.0.1

Steps to Reproduce

Build the package.

Screenshots

No response

Logs

No response

Platform

desktop

Device

desktop

Operating System

Arch Linux

Browser

Firefox

Additional Context

No response

Code of Conduct

Fallenbagel commented 1 week ago

This is not a bug of jellyseerr. Please keept github issues for bugs/feature requests of jellyseerr. We don't maintain AUR. Please report it there.

jkhsjdhjs commented 1 week ago

This issue isn't limited to the AUR package, it can be reproduced by simply building this package and pruning all dev dependencies.

Fallenbagel commented 1 week ago

connect-typeorm 1.1.4 └─┬ typeorm 0.3.12 peer └─┬ ts-node 10.9.1 peer └── typescript 4.9.5 peer react-intl 6.6.8 ├─┬ @formatjs/intl 2.10.4 │ └── typescript 4.9.5 peer └── typescript 4.9.5 peer typeorm 0.3.12 └─┬ ts-node 10.9.1 peer └── typescript 4.9.5 peer

These are coming from those packages. Those packages are required in production. Same with the swc which is coming from nextjs. Which is required for production. Pnpm doesn't prune removes the devdependencies of the project.

If you know of a solution, feel free to open a pr.

txtsd commented 1 week ago

See: https://github.com/pnpm/pnpm/issues/881

jkhsjdhjs commented 1 week ago

See: pnpm/pnpm#881

Hmm, that's bad. Ironic how pnpm is advertised as using less disk space :D

I tried using yarn instead and it still results in 1.1GiB node_modules. Maybe this is a general issue of the nodejs ecosystem?

gauthier-th commented 1 week ago

Hmm, that's bad. Ironic how pnpm is advertised as using less disk space :D

It is, when it re-use packages when you have multiple projects on your environment. That's not the case for production.

I tried using yarn instead and it still results in 1.1GiB node_modules. Maybe this is a general issue of the nodejs ecosystem?

We discussed about this quite a bit a few hours ago in the #development channel of the Jellyseerr Discord, if you want to come and take a look at our conclusions or if you have any other idea.