Atlantis styles do not load when project is deployed

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
gigantedocil
Posts: 3
Joined: 02 Aug 2017, 19:09

17 Sep 2021, 15:27

Hello, I acquired the Atlantis theme and I'm trying to deploy it on Heroku with an express.js server. My server.js code is the following:

Code: Select all

const express = require('express');
const path = require('path');
const app = express();

app.use(express.static(path.join(__dirname, 'dist/atlantis')));
app.use((_, res) => {
    res.sendFile(path.join(path.join(__dirname, 'dist/atlantis', 'index.html')));
});
  
const port = process.env.PORT || 4200;
  
app.listen(port, () => {
  console.log(`Listening on port ${port}`);
});
If I run ng build locally and node server.js everything works fine. However when I deploy it to Heroku it loads the app but not the styles:

Image

I have set up an example on https://atlantis-staging.herokuapp.com/ so that the issue can be reproduced. I'm using the latest version of the theme (12). Don't really know what could be wrong.

gigantedocil
Posts: 3
Joined: 02 Aug 2017, 19:09

20 Sep 2021, 11:24

I investigated a little bit more and found some weird things. When I SSH into the Heroku server and check the dist folder, the themes don't appear to be compiled, there are no css files only scss:

Image

In comparison, locally this is what the same folder has:

Image

The reason why the styles are not loading on Heroku is because the css file is not there, and the server falls back to the index.html and servees that file instead.

What could be causing the scss files to not be compiled? I'm running npm run build as my build command on Heroku too.

gigantedocil
Posts: 3
Joined: 02 Aug 2017, 19:09

20 Sep 2021, 15:28

Okay, so I found the issue. I needed to compile the sass files as an extra step to the regular ng build. Is there a reason why this step is not part of the ng build?

merve7
Posts: 861
Joined: 12 Sep 2017, 10:44

02 Oct 2021, 20:53

Hi,

Yes, you need compile sass files. Atlantis has 16 themes therefore we didn't add this step to part of ng build.

Best regards,
Merve Özçifçi

Post Reply

Return to “Atlantis - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests