-
Notifications
You must be signed in to change notification settings - Fork 823
Open
aws-amplify/amplify-cli-export-construct
#60Labels
bugSomething isn't workingSomething isn't workingexportIssues related to cdk-exported-backendIssues related to cdk-exported-backendp2transferredThis issue was transferred from another Amplify projectThis issue was transferred from another Amplify project
Description
When I try to import an Amplify app into a CDK stack defined in python I get the following error after cdk synth
. The same amplify app imported into a JavaScript CDK stack works.
$ node --version
v16.13.2
$ cdk --version
2.8.0 (build 8a5eb49)
# python dependencies setup
install_requires=[
"aws-amplify.cdk.exported-backend==0.0.5",
"aws-cdk.core==1.137.0",
"aws-cdk.aws-lambda==1.137.0",
"aws-cdk.aws-lambda-python==1.137.0",
"aws-cdk.aws-amplify==1.137.0",
"aws-cdk.aws-iam==1.137.0",
],
# JavaScript dependencies setup
"dependencies": {
"@aws-amplify/cdk-exported-backend": "^0.0.5",
"@aws-cdk/core": "1.137.0",
"@aws-cdk/aws-lambda": "1.137.0",
"@aws-cdk/aws-lambda-python": "1.137.0",
"@aws-cdk/aws-amplify": "1.137.0",
"@aws-cdk/aws-iam": "1.137.0",
"source-map-support": "^0.5.16"
}
jsii.errors.JavaScriptError:
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'lodash'
Require stack:
- /tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/export-backend-asset-handler/index.js
- /tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/export-backend.js
- /tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/index.js
- 2742
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/export-backend-asset-handler/index.js:10:11)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "app.py", line 12, in <module>
from cdk_amplify_import_test.cdk_amplify_import_test_stack import CdkAmplifyImportTestStack
File "/home/barabas/esp/cdk-amplify-import-test/cdk_amplify_import_test/cdk_amplify_import_test_stack.py", line 2, in <module>
from aws_amplify.cdk.exported_backend import AmplifyExportedBackend
File "/home/barabas/esp/cdk-amplify-import-test/.venv/lib/python3.8/site-packages/aws_amplify/cdk/exported_backend/__init__.py", line 74, in <module>
from ._jsii import *
File "/home/barabas/esp/cdk-amplify-import-test/.venv/lib/python3.8/site-packages/aws_amplify/cdk/exported_backend/_jsii/__init__.py", line 23, in <module>
__jsii_assembly__ = jsii.JSIIAssembly.load(
File "/home/barabas/esp/cdk-amplify-import-test/.venv/lib/python3.8/site-packages/jsii/_runtime.py", line 43, in load
_kernel.load(assembly.name, assembly.version, os.fspath(assembly_path))
File "/home/barabas/esp/cdk-amplify-import-test/.venv/lib/python3.8/site-packages/jsii/_kernel/__init__.py", line 269, in load
self.provider.load(LoadRequest(name=name, version=version, tarball=tarball))
File "/home/barabas/esp/cdk-amplify-import-test/.venv/lib/python3.8/site-packages/jsii/_kernel/providers/process.py", line 338, in load
return self._process.send(request, LoadResponse)
File "/home/barabas/esp/cdk-amplify-import-test/.venv/lib/python3.8/site-packages/jsii/_kernel/providers/process.py", line 326, in send
raise JSIIError(resp.error) from JavaScriptError(resp.stack)
jsii.errors.JSIIError: Cannot find module 'lodash'
Require stack:
- /tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/export-backend-asset-handler/index.js
- /tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/export-backend.js
- /tmp/jsii-kernel-7PvqTu/node_modules/@aws-amplify/cdk-exported-backend/lib/index.js
- 2742
Laplacian42
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingexportIssues related to cdk-exported-backendIssues related to cdk-exported-backendp2transferredThis issue was transferred from another Amplify projectThis issue was transferred from another Amplify project