Error: Cannot register a type name as a singleton without a "to" token
elmaedesistemas opened this issue · 2 comments
Hi! I have the following problem when I try to lift the api, and I was hoping you could help me to tell me what exactly is the problem, stay tuned, thanks!
ts-node-dev -r tsconfig-paths/register --inspect --transpileOnly --ignore-watch node_modules src/shared/infra/http/server.ts
Ignore watch: [ 'node_modules' ]
Using ts-node version 8.10.2, typescript version 3.9.3
Debugger listening on ws://127.0.0.1:9229/2c18c2a1-562f-491c-8ead-91c7cf04074e
For help, see: https://nodejs.org/en/docs/inspector
Error: Cannot register a type name as a singleton without a "to" token
at InternalDependencyContainer.registerSingleton (/home/cometacos/Workspaces/react-native/gobarber/backend/node_modules/tsyringe/dist/cjs/dependency-container.js:62:19)
at Object. (/home/cometacos/Workspaces/react-native/gobarber/backend/src/shared/container/providers/StorageProvider/index.ts:13:11)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Module._compile (/home/cometacos/Workspaces/react-native/gobarber/backend/node_modules/source-map-support/source-map-support.js:547:25)
at Module.m._compile (/tmp/ts-node-dev-hook-22357663000405603.js:57:25)
at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at require.extensions. (/tmp/ts-node-dev-hook-22357663000405603.js:59:14)
at Object.nodeDevHook [as .ts] (/home/cometacos/Workspaces/react-native/gobarber/backend/node_modules/ts-node-dev/lib/hook.js:61:7)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
[ERROR] 01:11:02 Error: Cannot register a type name as a singleton without a "to" token
You are probably passing a null value when doing a dependency injection.
Make sure that you create the .env file in the root folder, as described in the README.
I guess it solved the problem, if not, feel free to open another issue.
I am closing this one.