cancel
Showing results for 
Search instead for 
Did you mean: 

styles 404 in refresh

0 Kudos
385

I just made a configuration for spartacus 4.3 and everything went well, but it turns out that when I enter the first time I request the styles from this URL

<code>https://localhost:4200/styles.css

The time I refresh it request them from this url

<code>https://localhost:4200/electronics-spa/en/USD/styles.css

So I don't know if it is entirely related to something of the base Url or where do I configure this to avoid the 404 error.

thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hello Bernhard Luecke

Sorry I'll try to be more specific, I have installed a local recipe of SAP Commerce 2105 as a Backend and added all the data for a local SAP Spartacus 4.3 storefront

Everything is running fine, but when I add url params I have some issues on reloading the page.

provideConfig({
context: {
baseSite: [
'electronics-spa', //Selected by default because it is the first element in the list
'electronics',
],
language: [
'en'
],
currency: [
'USD'
],
urlParameters: ['baseSite'],
},
} as SiteContextConfig),

The first time the url is https://localhost:4200/ so the site finds all the required assets such as JS files and styles files.

After Spartacus append url params the url changes https://localhost:4200/electronics-spa/en/USD/ and the website tries to find the styles file in that url so it returns a 404 as it doesn't find the file in that specific url.

My issue is that I must force spartacus, angular (at this point don't even know where the config goes) to take the assets from the root url and not a url that contains params such as the base site, currency or language.

If more details are needed please let me know.

Bernhard
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jesus,

I´d kindly suggest to add more specific tags, e.g. "SAP Commerce" or "SAP Commerce Cloud", then the chance of obtaining an answer is quite higher.

Regards

Bernhard