What version of Effect is running?
4.0.0-beta.101
What steps can reproduce the bug?
Every Schema.decode* and Schema.encode* function throws at runtime when the effect package is transformed through babel-preset-expo in Jest. Schema creation and core Effect operations work fine — only the decode/encode pipeline is affected.
This blocks all React Native / Expo projects from upgrading to v4, since jest-expo requires effect in transformIgnorePatterns (effect is ESM-only).
Versions
effect: 4.0.0-beta.101
babel-preset-expo: ~57.0.0
jest: 29.7.0
- Node:
22
Reproduction
Minimal repo: https://github.com/DCKT/effect-v4-babel-bug
git clone https://github.com/DCKT/effect-v4-babel-bug.git
cd effect-v4-babel-bug
yarn install --ignore-engines
yarn test
Config is minimal — the jest config just has transformIgnorePatterns: ["node_modules/(?!effect/)"] and the babel.config.js only uses babel-preset-expo.
What is the expected behavior?
All tests should pass with correct decoding
What do you see instead?
Current behavior (9 tests: 3 pass, 6 fail)
| Test |
Error |
decodeUnknownSync(String) |
Cannot read properties of undefined (reading '_tag') at SchemaParser.ts:922 |
decodeUnknownSync(Struct) |
Cannot read properties of undefined (reading 'reasons') at Schema.ts:1413 |
decodeUnknownSync(decodeTo) |
Cannot read properties of undefined (reading '_tag') at Option.ts:85 |
decodeUnknownExit(String) |
Cannot read properties of undefined (reading '_tag') at SchemaParser.ts:922 |
decodeUnknownExit(Struct) |
Cannot read properties of undefined (reading 'reasons') at internal/effect.ts:269 |
encodeUnknownSync(Struct) |
Cannot read properties of undefined (reading 'reasons') at Schema.ts:1413 |
All 3 passing tests are non-decode operations: Schema.String / Schema.Struct creation and Option.some/none. |
|
Additional information
No response
What version of Effect is running?
4.0.0-beta.101
What steps can reproduce the bug?
Every Schema.decode* and Schema.encode* function throws at runtime when the effect package is transformed through babel-preset-expo in Jest. Schema creation and core Effect operations work fine — only the decode/encode pipeline is affected.
This blocks all React Native / Expo projects from upgrading to v4, since jest-expo requires effect in transformIgnorePatterns (effect is ESM-only).
Versions
effect:4.0.0-beta.101babel-preset-expo:~57.0.0jest:29.7.022Reproduction
Minimal repo: https://github.com/DCKT/effect-v4-babel-bug
Config is minimal — the
jestconfig just hastransformIgnorePatterns: ["node_modules/(?!effect/)"]and thebabel.config.jsonly usesbabel-preset-expo.What is the expected behavior?
All tests should pass with correct decoding
What do you see instead?
Current behavior (9 tests: 3 pass, 6 fail)
decodeUnknownSync(String)Cannot read properties of undefined (reading '_tag')atSchemaParser.ts:922decodeUnknownSync(Struct)Cannot read properties of undefined (reading 'reasons')atSchema.ts:1413decodeUnknownSync(decodeTo)Cannot read properties of undefined (reading '_tag')atOption.ts:85decodeUnknownExit(String)Cannot read properties of undefined (reading '_tag')atSchemaParser.ts:922decodeUnknownExit(Struct)Cannot read properties of undefined (reading 'reasons')atinternal/effect.ts:269encodeUnknownSync(Struct)Cannot read properties of undefined (reading 'reasons')atSchema.ts:1413Schema.String/Schema.Structcreation andOption.some/none.Additional information
No response