Skip to content

Fails on SyntaxError: Cannot use import statement outside a module #67

@madsvcarlsen

Description

@madsvcarlsen

Not sure if this project is abandoned, but here goes, since an image was pushed 2 days ago; I'm using the latest docker image, and it fails with the following:

rhythm-bot@2.1.5 start:prod /home/rhythmbot

NODE_ENV=production node --trace-warnings dist/app

== Migration20211031234554: migrating =======

/home/rhythmbot/migrations/Migration20211031234554.ts:1

import { Migration } from '@mikro-orm/migrations';

^^^^^^

SyntaxError: Cannot use import statement outside a module

at wrapSafe (internal/modules/cjs/loader.js:915:16)

at Module._compile (internal/modules/cjs/loader.js:963:27)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

at Module.load (internal/modules/cjs/loader.js:863:32)

at Function.Module._load (internal/modules/cjs/loader.js:708:14)

at Module.require (internal/modules/cjs/loader.js:887:19)

at require (internal/modules/cjs/helpers.js:74:18)

at Migrator.resolve (/home/rhythmbot/node_modules/@mikro-orm/migrations/Migrator.js:141:27)

at Object.customResolver (/home/rhythmbot/node_modules/@mikro-orm/migrations/Migrator.js:43:44)

at Migration.migration (/home/rhythmbot/node_modules/umzug/lib/migration.js:60:38)

at /home/rhythmbot/node_modules/umzug/lib/migration.js:121:37

at Generator.next (<anonymous>)

at asyncGeneratorStep (/home/rhythmbot/node_modules/umzug/lib/migration.js:9:103)

at _next (/home/rhythmbot/node_modules/umzug/lib/migration.js:11:194)

at /home/rhythmbot/node_modules/umzug/lib/migration.js:11:364

at new Promise (<anonymous>)

rhythm-bot@2.1.5 start:prod /home/rhythmbot

NODE_ENV=production node --trace-warnings dist/app

== Migration20211031234554: migrating =======

/home/rhythmbot/migrations/Migration20211031234554.ts:1

import { Migration } from '@mikro-orm/migrations';

^^^^^^

SyntaxError: Cannot use import statement outside a module

at wrapSafe (internal/modules/cjs/loader.js:915:16)

at Module._compile (internal/modules/cjs/loader.js:963:27)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

at Module.load (internal/modules/cjs/loader.js:863:32)

at Function.Module._load (internal/modules/cjs/loader.js:708:14)

at Module.require (internal/modules/cjs/loader.js:887:19)

at require (internal/modules/cjs/helpers.js:74:18)

at Migrator.resolve (/home/rhythmbot/node_modules/@mikro-orm/migrations/Migrator.js:141:27)

at Object.customResolver (/home/rhythmbot/node_modules/@mikro-orm/migrations/Migrator.js:43:44)

at Migration.migration (/home/rhythmbot/node_modules/umzug/lib/migration.js:60:38)

at /home/rhythmbot/node_modules/umzug/lib/migration.js:121:37

at Generator.next (<anonymous>)

at asyncGeneratorStep (/home/rhythmbot/node_modules/umzug/lib/migration.js:9:103)

at _next (/home/rhythmbot/node_modules/umzug/lib/migration.js:11:194)

at /home/rhythmbot/node_modules/umzug/lib/migration.js:11:364

at new Promise (<anonymous>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions