[solved] Vue app aliases are not allowed in server runtime
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
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:
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:
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:
----------------------<@109997634327986176> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@Titan maybe a module?
e.g. bumping nuxt security
@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