seanpmaxwell/overnight

Import class with path alias failed

Closed this issue · 1 comments

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!

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"