Open MarkMcCulloh opened 3 weeks ago
P1
On Thu, May 30, 2024 at 1:13 PM Mark McCulloh @.***> wrote:
I tried this:
log(nodeof(this).app.node.id);
Then run wing compile --rootId hello This happened:
Outputs "root" I expected this:
Outputs "hello" Is there a workaround?
No response Anything else?
No response Wing Version
No response Node.js Version
No response Platform(s)
No response Community Notes
- Please vote by adding a 👍 reaction to the issue to help us prioritize.
- If you are interested to work on this issue, please leave a comment.
— Reply to this email directly, view it on GitHub https://github.com/winglang/wing/issues/6598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAESGDC7FVK4QNQ2D6WE4V3ZE4CW5AVCNFSM6AAAAABIQWYYRCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDKMZZGI4TQMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
BTW, I think rootId
does change the name of the root but that's not necessarily reflected in app.id
.
Elad is right,
it seems like you can print the rootId by: log(util.tryEnv("WING_ROOT_ID") ?? "")
is it good enough? or it has to be passed through nodeof(this).app.node.id
?
In checking this again, it does work as expected in the non-sim targets. While WING_ROOT_ID is always set correctly, I had run into issues with this inconsistency at the construct/node level. I don't remember the actual problem at this point, but it makes sense for the sim to behave the same imo
it's because of this apparently, I'll take a look later to see if we can change it- https://github.com/winglang/wing/blob/main/libs/wingsdk/src/target-sim/app.ts#L93-L94
I tried this:
Then run
wing compile --rootId hello
This happened:
Outputs "root"
I expected this:
Outputs "hello"
Is there a workaround?
No response
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes