`new_in_static` corpus test fails at runtime: `scope.node._scopes is not iterable`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- aws, typescript
Research direction
Start with tests/valid/new_in_static.test.w and reproduce it using the tools/hangar pnpm commands for the tf-aws and sim cases. Trace the runtime handling of new X() in scope with a raw constructs.Construct, and inspect the constructs dependency and packages/@winglang/sdk references to _scopes. Done means the test can be re-enabled and both target cases pass while the unaffected new_in_static_lib.w case remains passing.
Written by the indexing model from the issue text.
Description
What
tests/valid/new_in_static.test.w fails on the current main, for both the wing compile -t tf-aws and wing test -t sim cases:
Error: scope.node._scopes is not iterable
--> new_in_static.test.w:9:12
9 | return new cloud.Bucket() in scope;
| ^
at createBucket .../tests/valid/new_in_static.test.w:9:12
at .../tests/valid/new_in_static.test.w:48:14
The failing path is a new X() in scope where scope is a bare constructs.Construct:
class MyClass {
pub static createBucket(scope: c.IConstruct): cloud.Bucket {
return new cloud.Bucket() in scope; // <-- throws at runtime
}
}
let scope = new c.Construct();
let bucket = MyClass.createBucket(scope); // line 48
Likely cause
node._scopes is an internal field of the constructs library, not Wing SDK code (grep -r _scopes packages/@winglang/sdk/src is empty). This looks like a constructs version incompatibility: a newer constructs changed/removed node._scopes, so the codegen/helper that resolves an explicit in scope against a raw Construct now iterates something that no longer exists.
How it surfaced
GitHub Actions on this repo was halted from 2025-07-23 until it was re-enabled on 2026-08-31. This failure is pre-existing on main and was simply not being caught while CI was down — it is unrelated to the change that surfaced it (the Wing Console sign-in removal / CI cleanup on claude/resume-qlgc79).
Action taken
To unblock CI (the release build's quality gate), the corpus test has been skipped via a skip: true meta-comment on tests/valid/new_in_static.test.w, rather than left red. This issue tracks re-enabling it once the new X() in scope runtime path is fixed. The new_in_static_lib.w compile case is unaffected and still runs.
Repro
cd tools/hangar && pnpm test:generate && pnpm run vitest new_in_static
Related: #6067 (the feature this test exercises).
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 217
- Avg merge
- 3h 45m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from winglang/wing
-
✨ enhancement needs-discussion
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
🐛 bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
🐛 bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Cognito APIs aren't proxied correctlyMay be free again @deepakstwt claimed this 143 days ago, and no pull request is open. Open🐛 bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timingOpene2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
devswha/herdr-web-ui#2884 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
b:minor bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-mansion/argent#1771 ·
Maintainers usually reply within 1 day
-
Resources: New palettes of XiamenPossibly taken @rmt-svc claimed this today. Openresources
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
railmapgen/rmg-palette#2491 ·
Maintainers usually reply within 4 days