adonisjs / mail

AdonisJS Email Provider
MIT License
106 stars 34 forks source link

Error: Cannot find module '@adonisjs/mail/build/config' with Docker #87

Closed c0c4i closed 1 year ago

c0c4i commented 1 year ago

Problem

Note I follow all steps from https://docs.adonisjs.com/cookbooks/dockerizing-adonis

I'm dockerizing my adonisjs app but when I try to docker compose up I have an error about this line in config/mail.ts.

import { mailConfig } from '@adonisjs/mail/build/config'

This is the error that gave me.

➜  treninoo-api git:(main) docker compose up
[+] Running 1/0
 ⠿ Container treninoo-api  Created                                                                                                                               0.0s
Attaching to treninoo-api
treninoo-api  | [ info ]  building project...
treninoo-api  | [ info ]  starting http server...
treninoo-api  | Debugger listening on ws://0.0.0.0:9229/31d3cc7f-6bc1-452b-a8c1-6474108fd871
treninoo-api  | For help, see: https://nodejs.org/en/docs/inspector
treninoo-api  | 
treninoo-api  | Error: Cannot find module '@adonisjs/mail/build/config'
treninoo-api  | Require stack:
treninoo-api  | - /home/node/app/config/mail.ts
treninoo-api  | - /home/node/app/node_modules/require-all/index.js
treninoo-api  | - /home/node/app/node_modules/@poppinss/utils/build/src/Helpers/requireAll.js
treninoo-api  | - /home/node/app/node_modules/@poppinss/utils/build/src/Helpers/index.js
treninoo-api  | - /home/node/app/node_modules/@poppinss/utils/build/helpers.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/fold/build/src/Ioc/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/fold/build/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/application/build/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/assembler/build/src/requireHook/ioc-transformer.js
treninoo-api  | - /home/node/app/node_modules/@poppinss/utils/build/src/esmRequire.js
treninoo-api  | - /home/node/app/node_modules/@poppinss/utils/build/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/require-ts/build/src/Compiler/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/require-ts/build/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/assembler/build/src/requireHook/index.js
treninoo-api  | - /home/node/app/node_modules/@adonisjs/assembler/build/register.js
treninoo-api  | - internal/preload
treninoo-api  | 
treninoo-api  | at /home/node/app/config/mail.ts(anonymous):9
treninoo-api  | 4    * Feel free to let us know via PR, if you find something broken in this contract
treninoo-api  | 5    * file.
treninoo-api  | 6    */
treninoo-api  | 7   
treninoo-api  | 8   import Env from '@ioc:Adonis/Core/Env'
treninoo-api  | 9   import { mailConfig } from '@adonisjs/mail/build/config'
treninoo-api  | 10  
treninoo-api  | 11  export default mailConfig({
treninoo-api  | 12    /*
treninoo-api  | 13    |--------------------------------------------------------------------------
treninoo-api  | 14    | Default mailer
treninoo-api  | 
treninoo-api  | 1 Module._compile
treninoo-api  |   /home/node/app/node_modules/pirates/lib/index.js:99
treninoo-api  | 
treninoo-api  | 2 Object.newLoader [as .ts]
treninoo-api  |   /home/node/app/node_modules/pirates/lib/index.js:104
treninoo-api  | 
treninoo-api  | [ warn ]  Underlying HTTP server died with "0 code"
treninoo-api  | [ info ]  watching file system for changes

BONUS (a sample repo to reproduce the issue)

This is the project I am developing, hope it can help.

https://github.com/c0c4i/treninoo-api

RomainLanz commented 1 year ago

Hey @c0c4i! 👋🏻

I have no issue building or running your container. Same with running via docker compose.

Julien-R44 commented 1 year ago

No answer so I'm closing issue