Cannot set context at app level after v1.9.0
See original GitHub issueCannot set context at app level anymore after v1.9.0. This is because a Tree
child is automatically created under the app and context cannot be set after children have been added.
Comes from #4194 (3cca03d).
Reproduction Steps
const app = new cdk.App();
app.node.setContext('stage', 'dev');
Error Log
Error: Cannot set context after children have been added: Tree
Environment
- CLI Version : > 1.9.0
- Framework Version: > 1.9.0
- OS : all
- Language : all
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Context | Android Developers
Return the set of parameters which this Context was created with, ... on what application context you can access; if the requested application...
Read more >Runtime context - AWS Cloud Development Kit (AWS CDK) v2
Context values that are set by the AWS CDK Toolkit (the cdk command) can be set automatically, from a file, or from the...
Read more >Docker Context - Docker Documentation
A Docker client that supports the top-level context command. Run docker context to verify that your Docker client supports contexts.
Read more >Defining Tomcat context paths - Octopus Deploy
A nested context path like myapp/v1 means the web app can be accessed from a URL like http://localhost:8080/myapp/v1.
Read more >Known issues — nRF Connect SDK 2.2.99 documentation
CIA-845: The application cannot be built with overlay-carrier.lib (carrier library) ... overlayv2.2.0v2.1.2v2.1.1v2.1.0v2.0.2v2.0.1v2.0.0v1.9.2v1.9.1v1.9.0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can specify the context when you initialise the app:
Closing for now.
@eladb In the case of setting context when we initialize the app, how should the nested structures be handled? Context is expecting [key: string]: string which doesn’t allow setting a key to a nested object. Trying to set the context for js unit test.