Next.js Discord

Discord Forum

tsyringe with App Router

Unanswered
English Cocker Spaniel posted this in #help-forum
Open in Discord
English Cocker SpanielOP
Anyone managed to get tsyringe working with v13 and app router?

A few people suggested some workarounds here (https://github.com/vercel/next.js/discussions/46805) but I can't seem to make any of them work, they all end up with reflect-metadata not being imported.

2 Replies

English Cocker SpanielOP
The require preload trick seems to work locally, haven't tried on an actual deployment (e.g. Vercel) which people mentioned they were having trouble with.

You basically just need to inject --require reflect-metadata on the node command invocation.
Cornish Rex
hi @English Cocker Spaniel , have you found any not so hacky solution for this?