-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected token error with cdk deploy on an existing stack project (written in Java) #20678
Comments
Same issue here with Node 12 and CDK (Python) 2.27.0 |
I am also getting the same error on local linux machine and also on jenkins pipeline. |
Bumping to Node 16 seems to have mitigated the issue. |
Same issue with: The same code worked yesterday, currently:
|
solving the problem? |
Seeing the same issue just started today (09/06/2022) - had been running fine in node v 8 and v 12 before today.
|
Experiencing the same issue. For now, I added "jsii == 1.59.0" in my requirement.txt, which temporarily fixed my issue. Open to better short term solution suggestions though while this is being fixed. |
upgrading to node 16 worked but just wondering how a specific combination of cdk, node and other dependent libraries versions suddenly stopped working |
We dropped support for node 12 in our latest JSII release https://github.com/aws/jsii/releases/tag/v1.60.0 Then released a hotfix because of the ?? issue aws/jsii#3588 This issue should be fixed? |
I tried both jsii at version 1.60.0 and 1.60.1 but sadly I am still seeing errors. For me the error is coming when I call something like: which is And it seems to fail here in JsiiRuntime:
because responseLine is null. This only happens on node 12 but I don't have the ability currently to update my pipeline to node 14 or 16 so need a fix. Versions: |
@emmapatterson I am also using CDK with Java, and I'm using node 12.22.12 and CDK 1.130.0. I was in a similar situation as you except I tried downgrading the transient depdendency Exception in thread "main" software.amazon.jsii.JsiiException: Unexpected token '?'
jsii-kernel-PGFecQ/node_modules/constructs/lib/construct.js:501
const nodeFactory = options.nodeFactory ?? { createNode: (host, nodeScope, nodeId) => new Node(host, nodeScope, nodeId) }; This was happening because of the transient dependency So, in summary, I can confirm that the following works with node 12.22.12:
With a build system like gradle that looks something like:
|
@ayachnes2 you are my hero. |
Duplicate of #20739 |
|
Hi, any updates ?
|
@LinTechSo Did you manage to resolve the error? I have the exact same issue. |
@th3outcast Upgrading to latest version of node fixes error as optional chaining was introduced in Node 14. |
Describe the bug
Hi I've an existing stack project written in Java. So far I've been deploying it using cdk deploy command and it was working as expected but suddenly since yesterday (with no change) I started getting error regardless of what the CDK template is. I tried with node versions v14.17.6, v10.16.3 and v10.19.0 but no luck. I doubt if other cdk commands like synth would also work or not
Expected Behavior
cdk deploy should generate cft and deploy it to AWS, like it was doing so far
Current Behavior
Getting below error
Exception in thread "main" software.amazon.jsii.JsiiException: Child process exited unexpectedly!
at software.amazon.jsii.JsiiRuntime.readNextResponse(JsiiRuntime.java:330)
at software.amazon.jsii.JsiiRuntime.handshake(JsiiRuntime.java:310)
at software.amazon.jsii.JsiiRuntime.startRuntimeIfNeeded(JsiiRuntime.java:300)
at software.amazon.jsii.JsiiRuntime.getClient(JsiiRuntime.java:346)
at software.amazon.jsii.JsiiEngine.getClient(JsiiEngine.java:150)
at software.amazon.jsii.JsiiEngine.loadModule(JsiiEngine.java:188)
at software.amazon.jsii.JsiiEngine.loadModule(JsiiEngine.java:185)
at software.amazon.jsii.JsiiEngine.createNewObject(JsiiEngine.java:597)
at software.amazon.awscdk.core.App.(App.java:86)
/tmp/jsii-java-runtime5137197359112545983/bin/jsii-runtime.js:3666
this.untested = opts.untested ?? false;
SyntaxError: Unexpected token ?
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Subprocess exited with error 1
Reproduction Steps
Any aws stack project written in java when trying to deploy using cdk deploy command
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.20.0
Framework Version
No response
Node.js Version
v14.17.6
OS
linux
Language
Java
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: