logologo
Guide
Practice
Configuration
Plugins
Showcase
Blog
Ecosystem
Module Federation Examples
Practical Module Federation
Zephyr Cloud
Nx
简体中文
English
Guide
Practice
Configuration
Plugins
Showcase
Blog
Module Federation Examples
Practical Module Federation
Zephyr Cloud
Nx
简体中文
English
logologo

Getting Started

Introduction
Setting Up the Environment
Quick Start Guide
Feature Navigation
Glossary of Terms
npm Packages

basic

Runtime

Runtime Access
Runtime API
Runtime Hooks
Rsbuild Plugin
Rspack Plugin
Webpack Plugin
Rspress Plugin
Vite Plugin
Metro
Type Hinting
Command Line Tool
Style Isolation

Data Solution

Data Fetching
Data Caching
Prefetch

Frameworks

Modern.js
Next.js

Deployment

Deploy with Zephyr Cloud

Debug

Enable debug mode
Chrome DevTools
Global variables

Troubleshooting

Overview

Runtime

RUNTIME-001
RUNTIME-002
RUNTIME-003
RUNTIME-004
RUNTIME-005
RUNTIME-006
RUNTIME-007
RUNTIME-008
RUNTIME-009

Build

BUILD-001
BUILD-002

Type

Overview
TYPE-001
Other
Edit this page on GitHub
Previous PageRUNTIME-004
Next PageRUNTIME-006

Invalid loadShareSync function call from bundler runtime

  • Error Code: RUNTIME-005

#Reasons

After Shared is set, the corresponding dependent library will be determined to be an asynchronous module. If the asynchronous entry is not enabled and eager: true is not set, then this error will occur.

#Solutions

Just choose one of the two:

  1. Enable asynchronous entry

If the @module-federation/modern-js plug-in is used, the corresponding asynchronous entry will be enabled based on the builder type by default.

But if it is build mode, then you still need to set the asynchronous entry manually.

Next, we will demonstrate how to enable asynchronous entry.

Create the bootstrap.js file and copy the contents of the original entry file here:

bootstrap.js
+ import React from 'react';
+ import ReactDOM from 'react-dom';
+ import App from './App';
+ ReactDOM.render(<App />, document.getElementById('root'));

Modify the content of the original entry file and reference bootstrap.js instead:

index.js
+ import('./bootstrap');
- import React from 'react';
- import ReactDOM from 'react-dom';
- import App from './App';
- ReactDOM.render(<App />, document.getElementById('root'));
  1. Set shared eager: true