Skip to content

React TypeError: Cannot read properties of undefined (reading 'exports') #173

@philals

Description

@philals

Thanks for spending the time to read this issue.

I have read and attempted fixes listed here:

Both host and remote are Vite projects

Versions

"@originjs/vite-plugin-federation": "1.1.4",

Reproduction

Clone this repo https://github.com/philals/reading-exports-issue/

cd into each directory and run npm install && npm run watch. This will run the container in dev mode (localhost:3000) and the remote served statically on localhost:3001

Confirm working

Uncomment this line: https://github.com/philals/reading-exports-issue/blob/master/app/src/App.tsx#L6

Refresh browser, issue encountered.

Additional Details

Steps to reproduce

Above

What is Expected?

All working

What is actually happening?

Error: Uncaught TypeError: Cannot read properties of undefined (reading 'exports')

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions