File not found error for some scania font files
Closed this issue · 4 comments
Getting an error in browser console as 'Failed to load resource: the server responded with a status of 404 (Not Found)' when I run a web application using SDDS themes and components in .net
To Reproduce
Steps to reproduce the behavior:
- Open Visual Studio. Go to File menu -> New Project
- New Project window will show up.
a) Choose Visual C# -> Web (from left side)
b) On Right side choose ASP.NET Web application (.Net Framework)
c) Click OK
d) Select Empty and then click OK - In Solution Explorer right click on project name -> Select Add -> New Item
- Select Web and from right side select npm configuration file and click Add
- package.json will be added to your project
- In package.json add below packages inside devDependencies and save the file
"@scania/components": "1.3.1",
"@scania/grid": "1.0.0",
"@scania/theme-light": "1.2.0",
"@scania/typography": "1.1.0" - In solution explorer click on see all files, you will see the node_modules folder having scania packages
- Again Right click on project in solution explorer, select Add -> New Item -> Select Web -> Select WebForm and click Add
- Copy Paste the below code in Webform.aspx
<script src="../node_modules/@scania/theme-light/dist/light-theme.js"></script>
<script src="../node_modules/@scania/components/dist/core.js"></script>
<c-navigation>
<a href='/home' slot='primary-items'>home</a>
<a href='/about' class='parent' slot='primary-items' active=''>about</a>
<a href='/profile' class='parent' slot='primary-items'>profile</a>
<a href='/abc' class='parent' slot='primary-items'>abc</a>
<a href='/xyz' class='parent' slot='primary-items'>xyz</a>
<a href='/more' slot='secondary-items'>more</a>
<c-navigation slot='sub' caption='About' target='/about' active=''>
<a href='/about' slot='primary-items' active=''>About 1</a>
<a href='/about2' slot='primary-items'>About 2</a>
<a href='/about3' slot='secondary-items'>About 3</a>
</c-navigation>
<c-navigation slot='sub' target='/profile'>
<a href='/profile' slot='primary-items'>Profile 1</a>
<a href='/profile2' slot='primary-items'>Profile 2</a>
<a href='/profile3' slot='secondary-items'>Profile 3</a>
</c-navigation>
<c-navigation slot='sub' target='/abc'>
<a href='/abc' slot='primary-items'>abc 1</a>
<a href='/abc2' slot='primary-items'>abc 2</a>
<a href='/abc3' slot='secondary-items'>abc 3</a>
</c-navigation>
<c-navigation slot='sub' target='/xyz'>
<a href='/xyz' slot='primary-items'>xyz 1</a>
<a href='/xyz2' slot='primary-items'>xyz 2</a>
<a href='/xyz3' slot='secondary-items'>xyz 3</a>
</c-navigation>
</c-navigation>
<c-content>
<section>
<h3>A Title of the page</h3>
<div class='alert alert-success' role='alert'>
A simple success alert—check it out!
</div>
<button class="sdds-btn sdds-btn-secondary">Secondary Button</button>
</section>
</c-content>
<div class="sdds-container">
<div class="sdds-row">
<div class="sdds-col-xxlg-16 sdds-col-xlg-16 sdds-col-lg-16 sdds-col-md-8 sdds-col-sm-4">
<div>
<sdds-accordion>
<sdds-accordion-item header="First item" affix="prefix" tabindex="1">
This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header. Lorem ipsum doler sit amet.
</sdds-accordion-item>
<sdds-accordion-item header="Second Item" affix="prefix" tabindex="2" expanded="true">
This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header. Lorem ipsum doler sit amet.
</sdds-accordion-item>
</sdds-accordion>
</div>
</div>
</div>
Expected behavior
Web application Runs displaying the output and there should not be any error messages shown in the browser console.
Actual Behavior
Application Runs but there are error messages in the browser console
Screenshots
![404error](https://user-images.githubusercontent.com/81211310/112109482-a8229400-8bd7-11eb-9702-9f49791e256f.PNG
Version of SDDS
E.g 1.0.0
Framework and version
If you use any specific framework please provide information
- Framework: [e.g .Net]
Desktop information:
Please complete the following information
- Browser [Chrome]
- Version [89]
- OS: [e.g. Windows 10]
Thanks for the issue report!
Seems like the issue is within the typography package. If you inspect you can see that the font files are loaded twice, one of them is loading the incorrect url. But the fonts do work. I haven't tried with given example
Issue can be viewed in #110 also
@mmexvr yes you are right the font files are loaded twice. At first they are loading from the scania theme package which has all the fonts. But i am unable to find out the initiator for the second time loading of font files. Can u help me in finding the solution for this
hello @kshekhar94 are you still experiencing this issue?
Just for your information, you don't need to install @scania/typography package if you are not using it for some complex scss function. Do you need to install that package?
I will try if I can replicate the issue. We do not test the CDN solution that much (using script in head)