event-driven-io / emmett

Emmett - a Node.js library taking your event-driven applications back to the future!
https://event-driven-io.github.io/emmett/
195 stars 19 forks source link

Fixed Dockerfile configuration to use esmodules instead of common js #121

Closed oskardudycz closed 1 month ago

oskardudycz commented 1 month ago

CommonJS file seems to be failing with

emmett_api    | SyntaxError: await is only valid in async functions and the top level bodies of modules
emmett_api    |     at wrapSafe (node:internal/modules/cjs/loader:1378:20)
emmett_api    |     at Module._compile (node:internal/modules/cjs/loader:1428:41)
emmett_api    |     at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
emmett_api    |     at Module.load (node:internal/modules/cjs/loader:1288:32)
emmett_api    |     at Module._load (node:internal/modules/cjs/loader:1104:12)
emmett_api    |     at Module.require (node:internal/modules/cjs/loader:1311:19)
emmett_api    |     at require (node:internal/modules/helpers:179:18)
emmett_api    |     at Object.<anonymous> (/app/dist/index.cjs:1:644)
emmett_api    |     at Module._compile (node:internal/modules/cjs/loader:1469:14)
emmett_api    |     at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
emmett_api    |
emmett_api    | Node.js v20.18.0

I'll need to investigate that later on. I also need to think about how to test Docker builds correctly.