-
-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
Version
npmPackages: @rslib/core: 0.0.14
Details
This is the examples of module federation, i found that would be error when i build, and i just import the button from @shopify/polaris.
import { init, loadRemote } from '@module-federation/enhanced/runtime';
import { Suspense, createElement, lazy } from 'react';
import { CounterButton } from './CounterButton';
import { useCounter } from './useCounter';
import { Button } from '@shopify/polaris'; // what i change
init({
name: 'rslib_provider',
remotes: [
{
name: 'mf_remote',
entry: 'http://localhost:3002/mf-manifest.json',
},
],
});
export const Counter: React.FC = () => {
const { count, increment, decrement } = useCounter();
return (
<div>
<Suspense fallback={<div>loading</div>}>
{createElement(
lazy(
() =>
loadRemote('mf_remote') as Promise<{
default: React.FC;
}>,
),
)}
</Suspense>
<Button primary />
<h2>
<span id="mf-e2e-lib-title">Counter From Rslib MF Format: </span>
<span id="mf-e2e-lib-content">{count}</span>
</h2>
<CounterButton id="mf-e2e-lib-decrease" onClick={decrement} label="-" />
<CounterButton id="mf-e2e-lib-increase" onClick={increment} label="+" />
</div>
);
};And this is the error when building the mf-react-componet
I think it might be an invalid identifier including '@' symbol, but how to solve that, could you please help review this?
Reproduce link
n
Reproduce Steps
- cd examples/module-federation/mf-react-component
- yarn add @[email protected]
- add
import {Button} from '@shopify-polaris'into the index.tsx - yarn build
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working
