core: problem in alias path.

when I define alias like this

const aliases = {
  MyModel: path.resolve(__dirname, "../app", "helper", "MyModel")
}

everything work but on the server I get an Error

Error: Cannot find module ‘/home/development/www/Cashineh-APIadonis/node_modules/@adonisjs/fold/src/Ioc/home/development/www/Cashineh-APIadonis/app/helper/MyModel’

I Change my alias path method to this one

const aliases = {
  MyModel: "App/helper/MyModel"
}

this worked but my hook not work any more. whats the problem?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

It works fine for me. Also your directory is uppercase Helpers and you are using lowercase helpers