N
Nuxt4w ago
Titan

[solved] Vue app aliases are not allowed in server runtime

[nitro 09:24:56] ERROR RollupError: [plugin impound] Vue app aliases are not allowed in server runtime. [importing #build/nuxt.config.mjs from node_modules/nuxt/dist/app/nuxt.js]
[nitro 09:24:56] ERROR RollupError: [plugin impound] Vue app aliases are not allowed in server runtime. [importing #build/nuxt.config.mjs from node_modules/nuxt/dist/app/nuxt.js]
How do I go about debugging this error? I've been through all my server/ files and checked I'm not importing anything from the client or Vue based and the error doesn't give any more hints about where the problem is.
4 Replies
kapa.ai
kapa.ai4w ago
Hi @Titan. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message you're seeing is related to the use of Vue app aliases in the server runtime, which is not allowed. This is because they are two totally different build contexts and even if it worked, it would result in two copies of the same code being bundled. To debug this issue, you can use the Node inspector to debug Nuxt server-side. You can start Nuxt in dev mode with the debugger active by running the following command:
nuxi dev --inspect
nuxi dev --inspect
This will allow you to attach to the debugger using your Chrome DevTools. Please note that the Node.js and Chrome processes need to be run on the same platform. This doesn't work inside of Docker. You can also debug your Nuxt app in your IDE while you are developing it. Here is an example of a VS Code Debug Configuration:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "client: chrome",
"url": "<http://localhost:3000",>
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "server: nuxt",
"outputCapture": "std",
"program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
"args": [
"dev"
],
}
],
"compounds": [
{
"name": "fullstack: nuxt",
"configurations": [
"server: nuxt",
"client: chrome"
]
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "client: chrome",
"url": "<http://localhost:3000",>
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "server: nuxt",
"outputCapture": "std",
"program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
"args": [
"dev"
],
}
],
"compounds": [
{
"name": "fullstack: nuxt",
"configurations": [
"server: nuxt",
"client: chrome"
]
}
]
}
If you prefer your usual browser extensions, add "userDataDir": false, to the chrome configuration above. For more information, you can refer to the Nuxt documentation on debugging (https://nuxt.com/docs/guide/going-further/debugging). If the issue persists, it might be helpful to check if there are any upstream libraries causing the issue. If that's the case, you can tell Nuxt not to try to import these libraries by adding them to build.transpile in your Nuxt configuration. In some cases, you may also need to manually alias the library to the CJS version. For more information, you can refer to the Nuxt documentation on troubleshooting ESM issues (https://nuxt.com/docs/guide/concepts/esm#troubleshooting-esm-issues). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4w ago
<@109997634327986176> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
manniL
manniL4w ago
@Titan maybe a module? e.g. bumping nuxt security
Titan
TitanOP4w ago
@manniL thanks, thought as much but disabled all modules in nuxt.config.ts without success found it, server was using a util from the client and although the function it used was pure, the file had some FE imports at the top
Want results from more Discord servers?
Add your server