Skip to content

Incorrect build output #9693

@vixalien

Description

@vixalien

Provide a general summary of the issue here

When running the built version of react-spectrum, sometimes I get an error: $5VBDY$propertiesmjs1 is not defined

🤔 Expected Behavior?

The error not to be there

😯 Current Behavior

The current trace is here:

ReferenceError: $5VBDY$propertiesmjs1 is not defined
    at $e3c5b37c91268204$var$classNamePrefix (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:192:19)
    at /home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:566:27
    at conditionalToRules (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:490:14)
    at compileRule (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:535:14)
    at /home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:422:14
    at conditionalToRules (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:490:14)
    at compileValue (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:421:12)
    at style (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/@react-spectrum+s2@1.1.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/packages/@react-spectrum/s2/style/style-macro.ts:270:23)
    at RouteComponent (/home/alien/sites/obelisk2/demo/src/routes/spectrum/index.tsx:17:21)
    at Object.react_stack_bottom_frame (/home/alien/sites/obelisk2/demo/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.node.development.js:10288:18)

💁 Possible Solution

If you check in the build output here: https://app.unpkg.com/@react-spectrum/s2@1.0.0/files/style/dist/style-macro.mjs

It seems that $5VBDY$propertiesmjs1 is indeed not defined, where it's used multiple times across that file, adding a simple

import $5VBDY$propertiesmjs1 from "./properties.mjs";
import $5VBDY$propertiesmjs2 from "./properties.mjs";

to the top of the file fixes it

🔦 Context

No response

🖥️ Steps to Reproduce

Just try running the application

Version

1.1.0

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

Linux

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

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