Skip to content

uuid (v4) fails to compile: default export name not wired up under compilePackages #837

@proggeramlug

Description

@proggeramlug

Surfaced by the #805 npm sweep harness (tier1 list).

Repro

```bash
mkdir /tmp/perry-uuid && cd /tmp/perry-uuid
cat > package.json <<'JSON'
{"name":"d","private":true,"type":"module","dependencies":{"uuid":"*"},"perry":{"compilePackages":["uuid"]}}
JSON
npm install
cat > main.ts <<'TS'
import { v4 } from "uuid";
console.log(v4());
TS
perry main.ts -o out
```

Failure

```
Undefined symbols for architecture arm64:
"___perry_wrap_perry_fn_node_modules_uuid_dist_v35_js__default", referenced from:
...
```

Diagnosis

`v35.js` in uuid's dist uses `export default factory()`. Perry generates a reference to the wrapper symbol `__default` but never emits the corresponding definition — the same shape as the `__null` / `__undefined` wrappers missing in #836 (zod). All three are reserved-ish names (`null`, `undefined`, `default`) that the codegen treats specially.

Suggested fix scope

The wrapper-symbol emission path needs to also fire for default-export and for re-exports under any name that happens to look like a JS keyword. Fix that and #836's null/undefined sub-bug should fall out for free.

Part of #793 + #805. Surfaced by the #805 sweep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparityNode.js compatibility / parity gaps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions