ERROR: Nuxt Build Error: [vite]: Rollup failed to resolve import "federation_fn_satisfy" from "virtual:federation_fn_import" #677
Unanswered
elenichvtz
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Nuxt 3 micro app that I am trying to build using the nuxt config below. When I add the shared inside vite and do 'npm run build', I get the error:
ERROR Nuxt Build Error: [vite]: Rollup failed to resolve import "federation_fn_satisfy" from "virtual:federation_fn_import".
This is most likely unintended because it can break your application at runtime.
If you want to externalize this module explicitly add it to
build.rollupOptions.external
my nuxt config js:
import federation from '@originjs/vite-plugin-federation';
export default defineNuxtConfig({
app: {
baseURL: '/',
},
build: {
publicPath: '/',
},
runtimeConfig: {
public: {
API_URL: process.env.API_URL
}
},
ssr: false,
vite: {
plugins: [
federation({
name: 'test',
filename: 'remoteEntry.js',
exposes: {
'./App': './pages/user-management/index.vue',
'./Router': './router/index.js',
'./Sidebar': './components/Sidebar.vue',
},
shared: {
vue: {
singleton: true,
requiredVersion: '^3.2.0', // Ensure shared Vue compatibility
},
},
remotes: {
main: ${process.env.APP_BASE_URL}/remoteEntry.js,
},
styles: {
injectTo: 'head',
},
publicPath: '/',
}),
],
},
nitro: {
preset: 'static',
},
});
Beta Was this translation helpful? Give feedback.
All reactions