When importing react-step-wizard as a default import in a project using Vite 8 (which uses Rolldown as its bundler), the import resolves to the entire module namespace object { default: StepWizardClass, Step: fn, __esModule: true } instead of the StepWizardClass itself. This causes a React render crash: "Element type is invalid: expected a string or class/function but got: object."
Root cause: The package's UMD bundle sets __esModule: true on its exports object and places the component on .default.
Rolldown does not use the __esModule flag to unwrap the default export the way esbuild and Rollup do.
Workaround:
import _StepWizard from 'react-step-wizard';
const StepWizard = (_StepWizard as any).default ?? _StepWizard;
Likely fix: Publishing an ESM build (with a "module" or "exports" field in package.json) would resolve this for all modern bundlers without needing a workaround.
Environment: Vite 8 / Rolldown, react-step-wizard v5.3.11
When importing
react-step-wizardas a default import in a project using Vite 8 (which uses Rolldown as its bundler), the import resolves to the entire module namespace object{ default: StepWizardClass, Step: fn, __esModule: true }instead of theStepWizardClassitself. This causes a React render crash: "Element type is invalid: expected a string or class/function but got: object."Root cause: The package's UMD bundle sets
__esModule: trueon its exports object and places the component on.default.Rolldown does not use the
__esModuleflag to unwrap the default export the way esbuild and Rollup do.Workaround:
Likely fix: Publishing an ESM build (with a
"module"or"exports"field inpackage.json) would resolve this for all modern bundlers without needing a workaround.Environment: Vite 8 / Rolldown, react-step-wizard v5.3.11