You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are trying to use local --debug for a CDK stack that relies on props it will crash due to the props being undefined.
Expected Behavior
It would be nice if samp local --debug would work for CDK stacks that relies on props.
Current Behavior
When starting samp local --debug on a CDK stack that relies on props it crashes.
VS Code Debug console
08.55.42 - Found 0 errors. Watching for file changes.
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'tableName')
at LambdaStack (<redacted>/code/test/samp-cdk-debug/.samp-out/lib/lambda-stack.js:11:41)
at <anonymous> (<redacted>/tools/image/packages/samp-cli/lib/node_modules/samp-cli/src/commands/local/cdk-wrapper.js:25:15)
at Module._compile (internal/modules/cjs/loader:1254:14)
at Module._extensions..js (internal/modules/cjs/loader:1308:10)
at Module.load (internal/modules/cjs/loader:1117:32)
at Module._load (internal/modules/cjs/loader:958:12)
at executeUserEntryPoint (internal/modules/run_main:81:12)
at <anonymous> (internal/main/run_main_module:23:47)
Ultimately what the code in cdk-wrapper does is that it's trying to create a map between Lambda functions in your synthed template and their locations on your local file system
I think I need to rethink this a bit. I've been working on CDK support for Python a bit and I'm using a completely different strategy there where I compare the md5 hashes in the CDK asset-folders and the local filesystem. With Pythin that's trivial since there's no compilation/minification going on.
I wonder if there's a way to get sourcemaps into the asset folders and simply direct the incoming requests that way.
If you are trying to use local --debug for a CDK stack that relies on props it will crash due to the props being undefined.
Expected Behavior
It would be nice if samp local --debug would work for CDK stacks that relies on props.
Current Behavior
When starting samp local --debug on a CDK stack that relies on props it crashes.
VS Code Debug console
Possible Solution
Not sure. Maybe it is necessary to instantiate the entire App, not only the stack.
I think this is the line were the stack is instantiated with an empty object as props.
https://github.com/ljacobsson/samp-cli/blob/main/src/commands/local/cdk-wrapper.js#L25
Steps to Reproduce (for bugs)
bin/samp-debug.ts
lib/table-stack.ts
lib/lambda-stack.ts
Environment
The text was updated successfully, but these errors were encountered: