wasp
wasp copied to clipboard
Ensure the different generated packages are using the same transitive dependencies
Currently, we have no mechanism to ensure that transitive dependencies are the same across the different packages of a Wasp app (user code, generated sdk, server, and client).
For example, in #2672, the following version mismatch was creating a typechecking error in the todo-typescript example:
todo-typescript $ npm why engine.io
[email protected]
node_modules/engine.io
engine.io@"~6.5.2" from [email protected]
node_modules/socket.io
socket.io@"^4.6.1" from [email protected]
.wasp/out/sdk/wasp
[email protected]
node_modules/wasp
wasp@"file:.wasp/out/sdk/wasp" from the root project
todo-typescript $ (cd .wasp/build/server && npm why engine.io)
[email protected]
node_modules/engine.io
engine.io@"~6.6.0" from [email protected]
node_modules/socket.io
socket.io@"^4.6.1" from the root project
[!IMPORTANT] Please note that both packages request
socket.io@^4.6.1, but one is installing[email protected], and the other[email protected].
This happens because the package-lock.json from the server is being regenerated on each build, so it picks up new versions, but the one from the user code isn't, so it's stuck in the old one.
We need a mechanism to share dependencies, to ensure that such situation doesn't happen.