-
Notifications
You must be signed in to change notification settings - Fork 249
Description
With what library do you have an issue?
native-federation
Reproduction of the bug/regression with instructions
is using "rollup-plugin-node-externals": "^4.1.1",
while trying to build I am getting error
` INFO Building federation artefacts
INFO Preparing shared npm packages for the platform browser
NOTE This only needs to be done once, as results are cached
NOTE Skip packages you don't want to share in your federation config
ERRR Error bundling shared npm package
ERRR (0 , rollup_plugin_node_externals_1.nodeExternals) is not a function
ERRR For more information, run in verbose mode
NOTE
NOTE
NOTE ** Important Information: ***
NOTE The error message above shows an issue with bundling a node_module.
NOTE In most cases this is because you (indirectly) shared a Node.js package,
NOTE while Native Federation builds for the browser.
NOTE You can move such packages into devDependencies or skip them in your federation.config.js.
NOTE
NOTE More Details: https://bit.ly/nf-issue
NOTE
NOTE
/home/msareen/code/mf-demo/react-remote/node_modules/@softarc/native-federation-esbuild/src/lib/adapter.js:106
(0, rollup_plugin_node_externals_1.nodeExternals)({ include: external }),
^
TypeError: (0 , rollup_plugin_node_externals_1.nodeExternals) is not a function
at /home/msareen/code/mf-demo/react-remote/node_modules/@softarc/native-federation-esbuild/src/lib/adapter.js:106:66
at Generator.next ()
at /home/msareen/code/mf-demo/react-remote/node_modules/tslib/tslib.js:170:75
at new Promise ()
at Object.__awaiter (/home/msareen/code/mf-demo/react-remote/node_modules/tslib/tslib.js:166:16)
at prepareNodePackage (/home/msareen/code/mf-demo/react-remote/node_modules/@softarc/native-federation-esbuild/src/lib/adapter.js:97:20)
at /home/msareen/code/mf-demo/react-remote/node_modules/@softarc/native-federation-esbuild/src/lib/adapter.js:31:23
at Generator.next ()
at /home/msareen/code/mf-demo/react-remote/node_modules/tslib/tslib.js:170:75
at new Promise ()
`
Trying to access the "nodeExternals" property, but the plugin only exports "externals."
Expected behavior
This error is go away when I override using
"@softarc/native-federation-esbuild": { "rollup-plugin-node-externals": "8.1.2" }
adaptor.js is using nodeExternal, which is not there in "rollup-plugin-node-externals": "^4.1.1",
it is there in 8.1.2, so this dependency need to be updated
Versions of Native/Module Federation, Angular, Node, Browser, and operating system
"@softarc/native-federation-esbuild": "^3.4.1",
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No