Skip to content

Fails to build zod v4 import for production #10175

@loganzartman

Description

@loganzartman

🐛 bug report

When importing anything from zod/v4, Parcel fails to emit a valid production bundle, with a runtime error like:

Uncaught ReferenceError: $99ddb65c04cf77f8$import$6c56dec3ecdf94f9 is not defined
    at index.js:4:16

This does not occur with the development server.

It seems to be related to scope hoisting, as --no-scope-hoist resolves the issue. Maybe this is similar to issues like #8792?

🎛 Configuration (.babelrc, package.json, cli command)

Default latest parcel configuration. See minimal repro: https://github.com/loganzartman/parcel-bug-zod-v4

🤔 Expected Behavior

There should be no runtime error when importing from zod/v4

😯 Current Behavior

Uncaught ReferenceError: $99ddb65c04cf77f8$import$6c56dec3ecdf94f9 is not defined
    at index.js:4:16

💁 Possible Solution

build with --no-scope-hoist

🔦 Context

Prevents using zod/v4

💻 Code Sample

https://github.com/loganzartman/parcel-bug-zod-v4

import {z} from 'zod/v4';

console.log(z.object({}));

🌍 Your Environment

Software Version(s)
Parcel 2.15.2
Node 22.11.0
npm/Yarn [email protected]
Operating System MacOS, Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions