Skip to content

HMR Error: "Cannot set properties of undefined" despite hot reload working #4054

@q3156277562

Description

@q3156277562

I have two modules: common and layout. The layout module imports and uses a utility class (e.g., from ./src/utils/performance.ts) from the common module.

A separate service (or application) then imports and uses both of these modules together. When Hot Module Replacement (HMR) is triggered, it throws the following error:
commonModule.js:180892 Uncaught TypeError: Cannot set properties of undefined (setting './src/utils/performance.ts')

The peculiar thing is that despite this error, the hot-reloaded code is actually applied and works correctly.

Originally posted by @q3156277562 in module-federation/module-federation-examples#4373

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