Reported here:
https://discord.com/channels/484437221055922177/1319673057849380995/1319673057849380995
Full report:
Hi, I am having this 2 errors when trying to .start() the client inside the Next.js (client-side).
Can't inject hook under the underlying hook token: Alias not found in mapping
Uncaught (in promise) Error: Cannot inject the dependency "n" at position #2 of "eX" constructor. Reason:
Attempted to resolve unregistered dependency token: "ProvableTransactionHook"
or:
Attempted to resolve unregistered dependency token: "ProvableBlockHook"
The strange thing is that this second error only happens after build and start, not in development.
I was able to fix the second error by doing:
import { container } from "tsyringe";
import { ProvableBlockHook, ProvableBlockHook } from "@proto-kit/protocol";
container.registerInstance("ProvableBlockHook", ProvableBlockHook);
container.registerInstance("ProvableBlockHook", ProvableBlockHook);
However I don't think it should be permanent. So please let me know if there is any way to fix or debug.
Note I am using React 18 but Next.js 15.