Skip to content
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

Object instances that are piped are corrupted in versions > 2.0.0-beta.2 #1325

Open
bitofbreeze opened this issue Feb 22, 2025 · 0 comments
Open

Comments

@bitofbreeze
Copy link

bitofbreeze commented Feb 22, 2025

Upgrading from 2.0.0-beta.2 to 2.0.4, my code that checks Cloudflare worker context:

type({
  KV: "object" as type.cast<KVNamespace>,
})
.pipe((env) => ({ ...env })
.assert(
  context.cloudflare.env,
);

used to produce the following type that is an instance of ProxyStub:

KV: ProxyStub { name: 'KvNamespace', poisoned: false },

but now produces this:

KV: [Object: null prototype] {},

I've confirmed the call to .pipe is the issue since removing it produces the correct result again. However, the call to .pipe did not corrupt the object in versions <= 2.0.0-beta.2, so this is clearly a bug.

For some added context, I have filed a similar issue in typebox owing to its Clone step: sinclairzx81/typebox#1186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

1 participant