Scott
05/10/2022, 6:34 AM❌ dev-medii-DatabaseStack: Received response status [FAILED] from custom resource. Message returned: Unexpected token 'export'
Logs: /aws/lambda/dev-medii-DatabaseStack-ClusterMigrationFunctionC4-Dqwx591T1sGb
export const up = async (db) => {
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:192:29)
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async FileMigrationProvider.getMigrations (/var/task/tmp/seed/source/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:6772:27)
at async Migrator.resolveMigrations_fn (/var/task/tmp/seed/source/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:6228:25) (RequestId: 3c501ccb-3f77-4c45-b55d-2b029c43ef44)
06:28:37 | UPDATE_IN_PROGRESS | AWS::CloudFormation::Stack | dev-medii-DatabaseStack
My local copy doesn't like commonjs, and if I convert them to .cjs files then the local SST console doesn't recognize them, is there some way I can tell seed to use ES modules instead of cjs?
my package.json and tsconfig.json are already set to moduleFrank
Frank
module.exports
instead of export
like this example? https://docs.serverless-stack.com/constructs/RDS#migrations-with-postgresqlScott
05/12/2022, 12:44 AMFrank
.js
file extension.Scott
05/12/2022, 12:49 AMScott
05/13/2022, 1:11 AMScott
05/19/2022, 3:24 AM