-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When I run npm run dev
, everything works fine, but after building and running preview, I get the following error:
Uncaught (in promise) Error: [ Federation Runtime ]: Failed to locate remote. #RUNTIME-004
args: {"hostName":"host","requestId":"remote/App"}
Here is my configuration:
// host
export default defineConfig({
plugins: [
VueRouter({
exclude: ['**/components/**', '**/composables/**'],
extensions: ['.vue', '.tsx'],
}),
vue(),
vueJsx(),
tailwindcss(),
vueDevTools(),
federation({
name: 'host',
remotes: {
remote: {
type: 'module',
name: 'remote',
entry: '/legacy-app/remoteEntry.js',
entryGlobalName: 'remote',
shareScope: 'default',
},
},
}),
topLevelAwait(),
],
build: {
target: 'chrome75',
},
resolve: {
alias: {
'~': fileURLToPath(new URL('./src', import.meta.url)),
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
proxy: {
'/legacy-app': {
target: 'http://localhost:9888/',
changeOrigin: true,
rewrite(path) {
return path.replace('/legacy-app', '')
},
},
},
},
})
federation({
name: 'remote',
filename: 'remoteEntry.js',
exposes: {
'./App': './src/main.js'
}
})
what's wrong with me?
I found a similar issue: module-federation/core#3710
Version
v6.2.4
Reproduction
maybe later
Relevant log output
Validations
- Read the docs.
- Read the common issues list.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
ci-shevchukh3adache
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working