I'm trying to run `sst deploy` and the process han...
# sst
r
I'm trying to run
sst deploy
and the process hangs at the point where it bundles the first function in the stack. Setting up
sst deploy
within a debug launch config I can see that it gets to this point in Functions.js:
Copy code
else {
            const bundled = core_2.Runtime.Handler.bundle({
                id: logicalId,
                root: root.appPath,
                handler: handler,
                runtime: runtime.toString(),
                srcPath: srcPath,
                bundle: props.bundle,
            });
We've tried this on a couple of different machines, one Windows and one Mac with the same result. I can run
sst start
successfully so it seems like a bundling problem, which the point of hanging would imply too. sst-debug.log looks like this when running deploy from a debugger - output is pratically identical doing a straight
sst deploy
(last line is a console log in the stack)
Copy code
[2021-12-23T12:40:17.939] [DEBUG] default - SST: 0.54.4
[2021-12-23T12:40:17.942] [DEBUG] default - CDK: 1.132.0
[2021-12-23T12:40:17.945] [INFO] default - Using stage: pjn-dev
[2021-12-23T12:40:17.948] [INFO] default - [90mPreparing your SST app[39m
[2021-12-23T12:40:18.181] [DEBUG] core - synth {
  output: '.build/cdk.out',
  app: 'node .build/run.js',
  rollback: true,
  roleArn: undefined,
  verbose: 0,
  noColor: false
}
[2021-12-23T12:40:18.392] [TRACE] cdk - Debugger attached.

[2021-12-23T12:40:20.742] [TRACE] cdk - Debugger attached.

[2021-12-23T12:40:42.010] [TRACE] cdk - Running locally? false
We're running sst v0.54.4. Any thoughts?
I can see that artifacts for the 1st function are written to the .sst directory too.
It's like it never returns after writing the files
This could just be really slow, I left it to go and make some lunch and came back to find it had carried on. It does however, seem much slower than before
t
How big is that file?
The portalUserHandler.js
r
4.2MB, map file is 6.4MB
t
do you have bundling steps?
beforeBundler, afterBundling, etc
oh looks like there are node_modules I wonder if that's what's taking long for some reason
The steps we do are 1. Before bundle hook 2. Run esbuild 3. beforeInstall hook 4. Install node_modules 5. After bundling hook Since you see the handler it looks like it got to at least #2
r
So what I found was that there was a compilation problem inside the lambda. However, when running from the command line it seemed to never throw and abort - it's possible I didn't wait long enough but it was left for at least 15 minutes. However, when stepping through, the esbuild bundle step would eventually throw an error and abort.