Garret Harp
01/18/2022, 6:08 PMError [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:'
Anyone know how to resolve this?thdxr
01/18/2022, 6:24 PMthdxr
01/18/2022, 6:24 PMGarret Harp
01/18/2022, 6:27 PMUnhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"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:'","reason":"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:'","promise":{},"stack":["Runtime.UnhandledPromiseRejection: 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 process.<anonymous> (file:///C:/Users/PC/Documents/Softgiving/platform-sst/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)"," at process.emit (events.js:400:28)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Garret Harp
01/18/2022, 7:32 PMthdxr
01/18/2022, 7:35 PMGarret Harp
01/18/2022, 7:43 PMprops.api.addRoutes(this, {
'GET /public/overlays/stats/{id}': {
function: {
handler: 'src/functions/http/public/overlays/stats.handler',
permissions: [props.resources.Dynamo],
environment: {
DYNAMO_TABLE_NAME: props.resources.Dynamo.tableName,
DYNAMO_TABLE_ARN: props.resources.Dynamo.tableArn
}
}
}
})
Jacoby
01/19/2022, 9:09 PMconst getMyTodosRoute: ApiFunctionRouteProps = {
function: {
handler: 'src/todos/getMyTodos.handler',
environment: { todosTable: todosTable.tableName },
permissions: [todosTable],
bundle: {
format: 'cjs', // or esm, issue is present on either option
},
},
};
Jacoby
01/19/2022, 9:11 PMthdxr
01/19/2022, 9:22 PMimport("<c://my/lambda//handler.js>")
which isn't allowed. Let me try and get a fix for this todaythdxr
01/19/2022, 9:22 PMJacoby
01/19/2022, 9:28 PMthdxr
01/20/2022, 1:54 PMthdxr
01/20/2022, 2:04 PMsst update 0.60.3-next.3+b863210b
Jacoby
01/20/2022, 2:27 PMJacoby
01/20/2022, 2:38 PM0.60.3-next.3
but error still persists:
Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"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:'","reason":"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:'","promise":{},"stack":["Runtime.UnhandledPromiseRejection: 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 process.<anonymous> (file:///C:/Users/user/Documents/sst-getting-started/server/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)"," at process.emit (events.js:315:20)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:94:32)"]}
thdxr
01/20/2022, 2:39 PMthdxr
01/20/2022, 2:39 PMJacoby
01/20/2022, 2:41 PM