N
Nuxt2w ago
System

Nuxt UI pro not working at all

I followed the exact setup what i see on https://ui.nuxt.com/getting-started/installation/pro/nuxt, however its just not working i keep getting the following error:
Cannot find module '~/assets/css/main.css' imported from 'virtual:nuxt:C%3A%2FUsers%2Fsteno%2FDocuments%2FGitHub%2Fnuxttest%2F.nuxt%2Fcss.mjs'.
Cannot find module '~/assets/css/main.css' imported from 'virtual:nuxt:C%3A%2FUsers%2Fsteno%2FDocuments%2FGitHub%2Fnuxttest%2F.nuxt%2Fcss.mjs'.
if i understand correctly you dont need a license for just testing it right? as long as you dont put it up online
8 Replies
kapa.ai
kapa.ai2w ago
Hi @System. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- You are correct: according to the official documentation, Nuxt UI Pro is free to use in development and you only need a license key to build your app for production or deploy it online. For local development and testing, no license is required — you can simply install and use the package without activating a license key. You will only need to set the license key (via the NUXT_UI_PRO_LICENSE environment variable) when building for production or deploying to a hosting provider Nuxt UI Pro License. Regarding your error:
Cannot find module '~/assets/css/main.css' imported from 'virtual:nuxt:C%3A%2FUsers%2Fsteno%2FDocuments%2FGitHub%2Fnuxttest%2F.nuxt%2Fcss.mjs'
Cannot find module '~/assets/css/main.css' imported from 'virtual:nuxt:C%3A%2FUsers%2Fsteno%2FDocuments%2FGitHub%2Fnuxttest%2F.nuxt%2Fcss.mjs'
This error means Nuxt cannot find the file at the path you specified. According to the Nuxt UI Pro installation guide, you should: 1. Create the file at assets/css/main.css (relative to your project root). 2. Add the following content to it:
@import "tailwindcss";
@import "@nuxt/ui-pro";

@import "tailwindcss";
@import "@nuxt/ui-pro";

3. In your nuxt.config.ts, add:
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro'],
css: ['~/assets/css/main.css']
})

export default defineNuxtConfig({
modules: ['@nuxt/ui-pro'],
css: ['~/assets/css/main.css']
})

Make sure: - The file is named exactly main.css and is located at assets/css/main.css (not app/assets/css/main.css unless you adjust the import path accordingly). - The path in your nuxt.config.ts matches the actual file location. - You have installed all required dependencies. If you follow these steps, Nuxt should be able to find and import your CSS file, and Nuxt UI Pro should work in development without a license key Nuxt UI Pro Installation. If you are still having issues, double-check the file path and ensure there are no typos or misplaced folders. If your project structure is different (for example, if you are using app/assets/css/main.css), update the path in your config to match:
css: ['~/app/assets/css/main.css']
css: ['~/app/assets/css/main.css']
But by default, the expected path is assets/css/main.css from the project root. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@479313721080938516> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
System
SystemOP2w ago
thats exactly what ive done but i still get that very same error @kapa.ai thats exactly what ive done but i still get that very same error
kapa.ai
kapa.ai2w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Based on the official Nuxt UI Pro installation guide, the expected setup is: - Your CSS file should be at assets/css/main.css (relative to your project root). - Your nuxt.config.ts should reference it as css: ['~/assets/css/main.css']. - The file should contain:
@import "tailwindcss";
@import "@nuxt/ui-pro";

@import "tailwindcss";
@import "@nuxt/ui-pro";

- The @nuxt/ui-pro module should be listed in your modules array Nuxt UI Pro Installation. However, your error message indicates Nuxt cannot find the file at ~/assets/css/main.css. According to the knowledge sources, in Nuxt 4, the ~ alias refers to the app subfolder, not the project root. This means if your file is at app/assets/css/main.css, you must reference it as ~/assets/css/main.css, but if it's at the project root (assets/css/main.css), you should use ~~/assets/css/main.css instead Github Issue: Cant read css file. Key points to check: - If your file is at assets/css/main.css (project root), use:
css: ['~~/assets/css/main.css']

css: ['~~/assets/css/main.css']

- If your file is at app/assets/css/main.css, use:
css: ['~/assets/css/main.css']

css: ['~/assets/css/main.css']

This alias change in Nuxt 4 is a common source of confusion and is confirmed in the issue discussion Github Issue: Cant read css file. Summary:
Double-check the actual location of your main.css file and ensure the alias in your nuxt.config.ts matches the new Nuxt 4 conventions. If you still encounter the error after correcting the path, the knowledge sources do not provide further troubleshooting steps specific to this issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@479313721080938516> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
System
SystemOP2w ago
@kapa.ai yeah changing it to have 2 tildes does not work
kapa.ai
kapa.ai2w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Thank you for clarifying. According to the knowledge sources, the issue with Nuxt not finding your CSS file (Cannot find module '~/assets/css/main.css') is related to how Nuxt 4 resolves the ~ and ~~ aliases. There is some confusion in the community about this, as discussed in the GitHub issue you referenced. Users have reported that in Nuxt 4, ~ refers to the app subfolder, while ~~ points to the project root. However, even after changing to ~~, some users (like yourself) still encounter the same error Github Issue: Cant read css file. The official Nuxt UI Pro documentation continues to recommend using ~/assets/css/main.css for the CSS path, assuming your file is at assets/css/main.css in the project root Nuxt UI Pro Installation. But the GitHub issue suggests that this may not always work as expected in Nuxt 4, especially if your directory structure differs or if there are alias resolution issues. To summarize: - The knowledge sources confirm this is a known pain point in Nuxt 4. - The recommended fix is to ensure your file path and alias match, but there are cases where even this does not resolve the issue. - There is no additional troubleshooting or workaround provided in the knowledge sources beyond checking your file location and alias usage. I'm sorry, but the knowledge sources do not contain enough information to provide a definitive solution if changing to ~~ does not work. This appears to be an unresolved or edge-case issue in Nuxt 4's alias resolution, as discussed in the GitHub thread. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@479313721080938516> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?