Anyone know why my migrations might be breaking fo...
# help
n
Anyone know why my migrations might be breaking for
RDS
construct? Getting the following error message
Copy code
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
    at new NodeError (internal/errors.js:322:7)
    at write_ (_http_outgoing.js:722:11)
    at ClientRequest.write (_http_outgoing.js:687:15)
    at C:\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\core\dist\runtime\server.js:110:25
    at Layer.handle [as handle_request] (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\route.js:137:13)
    at rawParser (C:\Users\noahd\Documents\Code\MendHealth\node_modules\body-parser\lib\types\raw.js:58:7)
    at Layer.handle [as handle_request] (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\route.js:137:13)
    at next (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\route.js:131:14)
143141db-f31f-4f14-b96e-2f0e1dbf4a8a ERROR Error: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' 
 Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
    at new NodeError (internal/errors.js:322:7)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:814:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at Loader.import (internal/modules/esm/loader.js:177:28)
    at importModuleDynamically (internal/modules/cjs/loader.js:1028:27)
    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
    at DynamicFileMigrationProvider.getMigrations (C:\Users\noahd\Documents\Code\MendHealth\.sst\artifacts\noah-mend-storage-stack-MendCoreDB-MigrationFunction\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\resources\dist\RDS_migrator\index.js:23226:115)
    at async Migrator.resolveMigrations_fn (C:\Users\noahd\Documents\Code\MendHealth\.sst\artifacts\noah-mend-storage-stack-MendCoreDB-MigrationFunction\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\resources\dist\RDS_migrator\index.js:22030:25)
    at async Migrator.getMigrations (C:\Users\noahd\Documents\Code\MendHealth\.sst\artifacts\noah-mend-storage-stack-MendCoreDB-MigrationFunction\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\resources\dist\RDS_migrator\index.js:21889:24)
My Current migration file
My RDS instance is setup as follows
Copy code
const devConfig: RDSScalingProps = {
      autoPause: true,
      minCapacity: 'ACU_2',
      maxCapacity: 'ACU_2',
    };
    this.db = new sst.RDS(this, 'db', {
      engine: 'mysql5.7',
      defaultDatabaseName: 'db',
      scaling: devConfig,
      migrations: 'src/migrations',
    });
I am on windows which might be an issue here ^
Also version of sst is
0.65.3
f
Hey @Noah D, can you try writing the migrations in JS? We currently don’t transpile the TS code, and just bundle them as in.
n
Hmm still seem to get the same errors unfortunately
t
Hm this error is from older versions of sst
Can you check the version of serverless-stack/core/package.json
In node_modules
Wait nevermind I was looking at the wrong error
This is a Windows specific bug, we can fix
n
Yea @thdxr just updated this morning to 0.65.4 to make sure too, same issue. If it helps that error only happens after I go into the migration tab of the console, which im guessing it is trying to run the migration but not having a good time on windows
j
Yup @thdxr is working on it.
n
Awesome, thanks for the update @Jay! Wondering in the meantime if there is any other way I can manually apply migrations to my development environment RDS instance?
t
This will be out today
@Noah D just released a fix
n
Hey @thdxr I am now able to get into the migrations tab fine, thanks for looking into this so quick!