I am trying to update my perviously working SST Ap...
# help
m
I am trying to update my perviously working SST App to 1.2.4 from 0.6.9. In the Upgrade docs it says to run npx sst build to see if you have successfully made all the necessary changes. However I keep getting this:
Copy code
(chartflow) Michaels-MBP-3:chartflow dramus$ AWS_PROFILE=chartflow npx sst build
Using stage: mike-local
Preparing your SST app
Synthesizing CDK

ReferenceError: __dirname is not defined in ES module scope
  at bundle (file:///Users/dramus/chartflow/node_modules/@serverless-stack/core/dist/runtime/handler/pythonBundling.js:40:31)
  at Object.bundle (file:///Users/dramus/chartflow/node_modules/@serverless-stack/core/dist/runtime/handler/python.js:33:27)
  at Module.bundle (file:///Users/dramus/chartflow/node_modules/@serverless-stack/core/dist/runtime/handler/index.js:16:16)
  at new Function (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Function.js:222:45)
  at Function.fromDefinition (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Function.js:405:20)
  at Table.addConsumer (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Table.js:300:23)
  at new Table (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Table.js:38:22)
  at new DynamodbStack (file:///Users/dramus/chartflow/.build/lib/index.js:14:26)
  at Module.main (file:///Users/dramus/chartflow/.build/lib/index.js:349:24)
  at file:///Users/dramus/chartflow/.build/run.mjs:92:16


There was an error synthesizing your app.
This doesn't seem to be coming from anything directly in my code, __dirname only appears in the .build directory
t
gotcha looking into this
should be fixed in 1.2.6
m
Updated and still seeing the issue even after deleting .build directory
Copy code
AWS_PROFILE=chartflow npx sst build
Using stage: mike-local
Preparing your SST app
Synthesizing CDK

ReferenceError: __dirname is not defined in ES module scope
    at bundle (file:///Users/dramus/chartflow/node_modules/@serverless-stack/core/dist/runtime/handler/pythonBundling.js:40:31)
    at Object.bundle (file:///Users/dramus/chartflow/node_modules/@serverless-stack/core/dist/runtime/handler/python.js:33:27)
    at Module.bundle (file:///Users/dramus/chartflow/node_modules/@serverless-stack/core/dist/runtime/handler/index.js:16:16)
    at new Function (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Function.js:222:45)
    at Function.fromDefinition (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Function.js:405:20)
    at Table.addConsumer (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Table.js:300:23)
    at new Table (file:///Users/dramus/chartflow/node_modules/@serverless-stack/resources/dist/Table.js:38:22)
    at new DynamodbStack (file:///Users/dramus/chartflow/.build/lib/index.js:14:26)
    at Module.main (file:///Users/dramus/chartflow/.build/lib/index.js:349:24)
    at file:///Users/dramus/chartflow/.build/run.mjs:92:16


There was an error synthesizing your app.
(chartflow) Michaels-MBP-3:chartflow dramus$ npx sst --version
SST: 1.2.6
CDK: 2.24.0
t
sorry I misread your stack trace let me try giving you as napshot build
can you update to
0.0.0-20220525193423
can use
sst update snapshot
m
It's doing stuff, so that fixed that issue... Thanks a lot
t
cool will release this soon
r
I’m seeing the same after updating to the snapshot
Copy code
ReferenceError: __dirname is not defined in ES module scope
    at Script.createCustomResourceFunction (file:///Users/rosscoundon/Documents/GitHub/wheres_my_tech/node_modules/@serverless-stack/resources/dist/Script.js:98:51)
    at new Script (file:///Users/rosscoundon/Documents/GitHub/wheres_my_tech/node_modules/@serverless-stack/resources/dist/Script.js:49:33)
    at new OmwOfscBeStack (file:///Users/rosscoundon/Documents/GitHub/wheres_my_tech/.build/lib/index.js:1183:7)
    at Module.main (file:///Users/rosscoundon/Documents/GitHub/wheres_my_tech/.build/lib/index.js:1340:3)
    at file:///Users/rosscoundon/Documents/GitHub/wheres_my_tech/.build/run.mjs:92:16
Copy code
"@serverless-stack/cli": "0.0.0-20220525193423",
    "@serverless-stack/resources": "0.0.0-20220525193423",
t
fixing this
r
cool