kritstabs
05/25/2022, 4:42 PM2022-05-25T16:08:35.058Z undefined ERROR Uncaught Exception {
"errorType": "Runtime.UserCodeSyntaxError",
"errorMessage": "SyntaxError: Cannot use import statement outside a module",
"stack": [
"Runtime.UserCodeSyntaxError: SyntaxError: Cannot use import statement outside a module",
" at _loadUserApp (file:///var/runtime/index.mjs:724:17)",
" at async Object.module.exports.load (file:///var/runtime/index.mjs:741:21)",
" at async file:///var/runtime/index.mjs:781:15",
" at async file:///var/runtime/index.mjs:4:1"
]
}
thdxr
05/25/2022, 4:46 PMthdxr
05/25/2022, 4:46 PMthdxr
05/25/2022, 4:46 PMkritstabs
05/25/2022, 4:48 PMmigrations: "backend/migrations"
line and then deployment is successful.thdxr
05/25/2022, 4:50 PMthdxr
05/25/2022, 4:50 PMfirst.js
-> first.cjs
kritstabs
05/25/2022, 4:51 PMkritstabs
05/25/2022, 5:07 PMthdxr
05/25/2022, 5:09 PMthdxr
05/25/2022, 5:09 PMAR
05/25/2022, 5:14 PM.cjs
. i tried running a sst remove
to clear the project but likewise it won't let me remove that stack either with similar error:
❌ dev-my-sst-app-Database failed: Error: Stack dev-my-sst-app-Database is in the CREATE_IN_PROGRESS state. It cannot be destroyed.
thdxr
05/25/2022, 5:14 PMthdxr
05/25/2022, 5:15 PMthdxr
05/25/2022, 5:15 PMthdxr
05/25/2022, 5:15 PMkritstabs
05/25/2022, 5:17 PMthdxr
05/25/2022, 5:34 PMthdxr
05/25/2022, 6:36 PMthdxr
05/25/2022, 6:36 PMthdxr
05/25/2022, 6:37 PMkritstabs
05/25/2022, 6:37 PMthdxr
05/25/2022, 6:38 PMthdxr
05/25/2022, 6:38 PMkritstabs
05/25/2022, 6:39 PMkritstabs
05/25/2022, 6:41 PMthdxr
05/25/2022, 6:41 PMthdxr
05/25/2022, 6:41 PMAR
05/25/2022, 9:11 PMthdxr
05/25/2022, 9:11 PMkritstabs
05/26/2022, 8:58 AMkritstabs
05/26/2022, 10:02 AMyarn sst start
and it deployed without errors
• Applied first and second migration through SST console
• yarn sst deploy
and got the following error message in rdsMigrationFunction
logs
2022-05-26T09:30:29.734Z 0921227a-9d23-4f2f-8083-a59dfdac75f8 ERROR Invoke Error {
"errorType": "Error",
"errorMessage": "corrupted migrations: previously executed migration first. is missing",
"stack": [
"Error: corrupted migrations: previously executed migration first. is missing",
" at Migrator.ensureMigrationsNotCorrupted_fn (/var/task/Users/kristaps/projects/ideal-stack-preview/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:6237:13)",
" at Migrator.getState_fn (/var/task/Users/kristaps/projects/ideal-stack-preview/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:6215:89)",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)",
" at async run (/var/task/Users/kristaps/projects/ideal-stack-preview/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:6187:21)",
" at async _TransactionBuilder.execute (/var/task/Users/kristaps/projects/ideal-stack-preview/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:5102:22)",
" at async Migrator.migrate_fn (/var/task/Users/kristaps/projects/ideal-stack-preview/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:6120:12)",
" at async Runtime.handler (/var/task/Users/kristaps/projects/ideal-stack-preview/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:7391:20)"
]
}
PS. Is it intended to always run sst deploy command on “prod” stage? When I run it on non existing stage yarn sst deploy --stage random
then I don’t see that error. Thanks.