seanpmaxwell / overnight

TypeScript decorators for the ExpressJS Server.
MIT License
878 stars 40 forks source link

Import class with path alias failed #5

Closed ch4rlesyeo closed 5 years ago

ch4rlesyeo commented 5 years ago

Hi, first of all thanks for creating such awesome library. I'm in the middle of trying OvernightJS and having problem trying to import a class into my controller, got an error saying : image

UserController : image

CompanyModelClass : image

tsconfig : image

package.json : image

Somehow when I changed the import to '../models/company' and it works. Also importing '@Models/firebase' works fine too.

I'm quite new to typescript, sry if this question isn't related to OvernightJS itself.

Thanks and appreciate a lot!

ch4rlesyeo commented 5 years ago

The issue solved when added tsconfig-paths into run scripts :

"dev": "nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' --exec 'ts-node' -r tsconfig-paths/register src/index.ts"