The theme could not be compiled: . . . Cannot open file

0
Hi everyone. I am new to Mendix, but after following the tutorial, I created my first app using the blank template. Immediately upon downloading and making no changes, I have an error that reads The theme could not be compiled: Error reading . . . \theme.compiled.css.map: Cannot open file. I checked and the file is in the directory so any insight on to why this is happening would be really helpful so that I can launch the website locally. Thank you!
asked
4 answers
3

Dear bros, 

I facing the same issue, is there any solution for this?

Details as:

11The theme could not be compiled:
Error: Undefined variable.
  ,
30 |         @media screen and (min-width: $screen-lg) {
  |                                       ^^^^^^^^^^
  '
 D:\newapp-main\themesource\datawidgets\web\gallery.scss 30:39  @import
 D:\newapp-main\themesource\datawidgets\web\main.scss 7:9       @use
 D:\newapp-main\deployment\sass\main.scss 7:1                   root stylesheet---

 

 

Thank for support

answered
0

Hard to tell. Just now tried the same, created a new app using the blank template. And that worked fine. If this gets you stuck, then this is not the first experience you want with Mendix. To get going, try another template or even better, try to start using the Base-application: https://marketplace.mendix.com/link/component/117760/Tieka/Base-application

This base application is has a lot of entities and functions that you will be using in your apps and it shows you how an application should be built up, having no errors or warnings, no superfluous page- and popup-templates, no duplicate jar-files, nice modular setup, etc.

Have fun

 

 

answered
0

Go to App > Select Synchronize App Directory

Then run application again.
Hope it will help!

answered
0

Hi,


This error usually happens when the Atlas theme was not compiled correctly or the theme cache is corrupted. Mendix compiles the theme using Node + Sass, and if the compiled files or cache are broken, you will see errors like:

The theme could not be compiled
Error reading ./theme.compiled.css.map: Cannot open file

Even though the file exists, the compiler sometimes cannot read it due to a corrupted deployment folder or incomplete theme build.

The fix is straightforward.

1. Clean the deployment directory

In Mendix Studio Pro:

Project → Clean Deployment Directory

Then run the app again.

This forces Mendix to:

  • delete the old compiled theme
  • rebuild the CSS
  • regenerate theme.compiled.css and .map files

In most cases this alone fixes the problem.

2. Delete the deployment folder manually

If the error still appears:

  1. Close Mendix Studio Pro
  2. Go to your project folder
  3. Delete the entire folder:
deployment

  1. Open the project again
  2. Run the application

Mendix will rebuild everything from scratch.

3. Check Node installation (important for new installations)

Theme compilation requires Node.js.

Check your version:

node -v

Recommended versions for Mendix 9.x are usually:

Node 16 LTS
or
Node 18 LTS

If Node is missing or incompatible, the theme compilation step can fail.

4. Reinstall the Atlas UI resources (if needed)

Sometimes the theme folder becomes corrupted.

Go to:

App → App Settings → Atlas UI Resources

Click:

Update Atlas UI Resources

This refreshes the theme files.

5. If the project was downloaded from Git

Run:

Project → Clean Deployment Directory

before starting the app the first time.


This error is usually caused by a corrupted compiled theme or deployment cache.

The correct fix is:

  1. Project → Clean Deployment Directory
  2. If needed delete the deployment folder manually
  3. Ensure Node.js is installed

After that the theme will compile correctly and the app will run.


answered