You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// exposed component
import Xcomponent from '@privatescope/xcomponent'
const Test = () => {
return ()
}
export default Test ;
// host , component usage
import Test from 'collection/Test';
...
...
when run console.log(Test) the result is this
Once I tried to run Remote project by its own alone it works fine the componnt is there instead of this module chain, but when I tried the use same component () inside the host error is there .
vitejs/vite#16201
also i find this issue its kinda similar but solutions that they put is not working for me.
The text was updated successfully, but these errors were encountered:
Discussed in #652
Originally posted by necatisarhanli December 31, 2024
Remote Vite config
export default defineConfig({
plugins: [
react(),
federation({
name: 'collection',
filename: 'remoteEntry.js',
shareScope: 'default',
exposes: {
'./Test': './src/Test',
},
shared: [
"react",
"react-dom",
"react-router-dom",
"@privatescope/xcomponent",
],
})
],
build: {
sourcemap: false,
target: 'esnext',
minify: false,
cssCodeSplit: false,
rollupOptions: {
output: {
interop: "auto"
},
},
terserOptions: {
compress: false,
mangle: false,
},
},
})
Host Vite Config
export default defineConfig({
plugins: [
react(),
legacy({
targets: ['defaults', 'not IE 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
}),
federation({
name: "host",
remotes: {
collection: "http://localhost:5002/assets/remoteEntry.js"
},
shared: [
"react",
"react-dom",
"react-router-dom",
"@privatescope/xcomponent",
],
}),
],
define: {
global: 'window',
},
build: {
sourcemap: false,
target: 'es2015',
minify: false,
cssCodeSplit: false,
},
server: {
port: 6161,
},
resolve: {
alias: {
[...]
},
},
})
// exposed component
import Xcomponent from '@privatescope/xcomponent'
const Test = () => {
return ()
}
export default Test ;
// host , component usage
import Test from 'collection/Test';
...
...
when run console.log(Test) the result is this
Once I tried to run Remote project by its own alone it works fine the componnt is there instead of this module chain, but when I tried the use same component () inside the host error is there .
vitejs/vite#16201
also i find this issue its kinda similar but solutions that they put is not working for me.
The text was updated successfully, but these errors were encountered: