Hello everybody. I'm trying to upgrade sst version...
# help
f
Hello everybody. I'm trying to upgrade sst version to latest and when I'm tyring to use start get this error:
Copy code
Preparing your SST app

=======================
 Deploying debug stack
=======================

node:internal/errors:465
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
    at new NodeError (node:internal/errors:372:5)
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1120:11)
    at defaultResolve (node:internal/modules/esm/resolve:1200:3)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ESMLoader.import (node:internal/modules/esm/loader:380:22)
    at importModuleDynamically (node:internal/modules/esm/translators:106:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
    at file:///D:/Projects/MyProject/sst/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.mjs:20:46 {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

There was an error synthesizing your app.
t
Hey are you in windows?
I'll take a look at this shortly
f
Yes sir
Also tried to use 1.2.0 version and get error:
Copy code
Build failed with 1 error:
error: The entry point "D:\\Projects\\MyProject\\sst\\stacks\\index.js" cannot be marked as external
t
might need to send you a few snapshot builds to work through this
are you around to test with me for a bit?
f
Yes
t
ok run
sst update snapshot
should get you the snapshot I just published and then try starting up again
f
Well it started the session 😳
After using snapshot got this
Copy code
D:\Projects\MyProject\sst>npx sst update snapshot
Updating @serverless-stack/cli to snapshot
Updating @serverless-stack/resources to snapshot
Updating aws-cdk-lib@2.24.0
SST: 0.0.0-20220525235345
CDK: 2.24.0

D:\Projects\MyProject\sst>npm start

> TestAdapters@0.1.0 start
> npx sst start --stage envdev

Using stage: envdev
Preparing your SST app

=======================
 Deploying debug stack
=======================


Deploying stacks
ExpiredToken: The security token included in the request is expired
    at Request.extractError (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\protocol\query.js:50:29)
    at Request.callListeners (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
    at Request.emit (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
    at Request.emit (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\request.js:686:14)
    at Request.transition (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request.<anonymous> (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\request.js:688:12)
    at Request.callListeners (D:\Projects\MyProject\sst\node_modules\aws-sdk\lib\sequential_executor.js:116:18) {
  code: 'ExpiredToken',
  time: 2022-05-25T23:58:02.984Z,
  requestId: '9eda36f8-f459-44ff-8042-2fe8b2ce541d',
  statusCode: 403,
  retryable: true
}

 ❌  envdev-TestAdapters-debug-stack failed: ExpiredToken: The security token included in the request is expired


Stack envdev-TestAdapters-debug-stack
  Status: failed
  Error: The security token included in the request is expired

Failed to deploy the debug stack

D:\Projects\MyProject\sst>npm start

> TestAdapters@0.1.0 start
> npx sst start --stage envdev

Using stage: envdev
Preparing your SST app

=======================
 Deploying debug stack
=======================


Deploying stacks
Checking deploy status...

 ✅  envdev-TestAdapters-debug-stack


Stack envdev-TestAdapters-debug-stack
  Status: deployed
  Outputs:
    BucketArn: arn:aws:s3:::envdev-TestAdapters-debug-sta-bucket83908e77-itu3hccpv50b
    BucketName: envdev-TestAdapters-debug-sta-bucket83908e77-itu3hccpv50b
    Endpoint: <wss://rfl0oykc59.execute-api.us-west-2.amazonaws.com/envdev>


===============
 Deploying app
===============


Library 'es2021' specified in compilerOptions

D:/Projects/MyProject/sst/sst/node_modules/esbuild/lib/main.d.ts (582,16): Cannot find namespace 'WebAssembly'.
580.    */
581.   wasmModule?: WebAssembly.Module
582.

D:/Project/MyProject/sst/stacks/TestAdaptersStack.js (9,13): Object literal may only specify known properties, and 'defaultFunctionProps' does not exist in type 'ApiProps<Record<string, ApiAuthorizer>, string>'.
7.         const api = new sst.Api(this, "Api", {
8.             defaultFunctionProps: {
9.                 srcPath: "../../src/Api",
Deploying stacks
Checking deploy status...
Checking deploy status...


 ✅  envdev-TestAdapters-comms-adapters-stack


Stack envdev-TestAdapters-comms-adapters-stack
  Status: deployed
  Outputs:
    ApiEndpoint: <https://kc34mzg5ag.execute-api.us-west-2.amazonaws.com>


==========================
 Starting Live Lambda Dev
==========================

SST Console: <https://console.serverless-stack.com/TestAdapters/envdev/local>
Debug session started. Listening for requests...
Do you need me to do anything else?
t
looks good but where did you get this project template from?
looks like it's for < 1.0
f
When I used command snapshot changed this in package json and now it's:
Copy code
"dependencies": {
    "@serverless-stack/cli": "0.0.0-20220525235345",
    "@serverless-stack/resources": "0.0.0-20220525235345",
    "aws-cdk-lib": "2.24.0",
    "serverless-plugin-typescript": "^1.1.7"
  }
Just noticed that right now
t
yeah but I meant where did you get this template from or is this your own project?
defaultFunctionProps isn't a thing in 1.0+
f
I used the npx create-app --language csharp and got that template
t
the new command is
npm init sst
or
yarn create sst
f
I created this template about 2 months ago, and tried to upgrade with npx sst update v1.2.7 today and started to get errors
e
Me too! 🙃 How can we remove this warning?
t
this is fixed in latest!
f
It's fixed on latest version