Hey everyone, I’m banging my head against the wall trying to set up a micro-frontend using Nuxt3. I started a new project with npx nuxi@latest init remote
and added the vite module federation configs to my nuxt.config.ts file. I’m trying to expose a simple HelloWorld component.
Here’s what my setup looks like:
<!-- components/GreetingMessage.vue -->
<template>
<div>
<p>Greetings from the remote app!</p>
</div>
</template>
// nuxt.config.ts
import moduleFed from '@originjs/vite-plugin-federation';
export default defineNuxtConfig({
// other config stuff
vite: {
plugins: [
moduleFed({
name: 'remoteApp',
filename: 'remoteEntry.js',
exposes: {
'./GreetingMessage': './components/GreetingMessage.vue'
}
})
]
}
})
But as soon as I add the moduleFed plugin, I get this nasty error:
ERROR Expression expected
The weird thing is, I can still see the output in the browser if I import the GreetingMessage component into app.vue. I’ve also tried integrating this with my host app, but I still get the same error. I’m totally stuck here. Any ideas on what might be causing this and how to fix it?