Angular cssSyntaxError in application - css

I have an error that comes from my css file.
The full error message is this:
ERROR in ./src/assets/all.css (./node_modules/#angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/assets/all.css)
Module Error (from ./node_modules/postcss-loader/src/index.js):
(Emitted value instead of an instance of Error) CssSyntaxError: myfolder\src\assets\all.css:5556:189: Can't resolve '../webfonts/fa-brands-400.ttf' in 'myfolder\src\assets'
This is how my folder structure looks like:
My project
`-- src
|-- app
| `-- components
`-- assets
`-- all.css
I tried putting my css code inside the assets folder didn't work. How can I fix this error, error occurs only with the fonts inside the css file.

Related

How to fix module not found error in vue cli?

I am getting following error when I am trying to run my vue cli application. I have put my style.css file in assests folder and images in public/images folder.Then I have imported css file into main.js folder like this:"import "./assets/style.css";" Can anyone help me out. I have paste the error below.
My app was working before but Its not working now.
This relative module was not found:
* ./images/beeton-small-logo.png in ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/style.css

Symfony 4 404 Page not found on all routes except root

I have installed symfony 4 on my shared hosting.
My structure is like this:
ROOT
|
|-- public_html
|
|-- tst
|-- tst
|
|-- bin
|-- config
|-- src
|-- translations
|-- var
|-- vendor
|-- composer.json
|-- composer.lock
|-- binsymfony.lock
I moved index.php from the public folder to the public_html/tst folder and changed the paths inside that file to match the new structure:
require __DIR__.'/../../tst/vendor/autoload.php';
Now, when running http://mysite/tst, I get the homepage of the site as expected. But when I try another route (other than "/"), I always receive a 404 page not found.
Does this have something to do with privileges of am I missing something?
I figured this one out myself, but if someone tell me how to deploy a Symfony 4 application to a shared hosting, please tell me! I think other people will like this too...
You can create symlik for Public. The method you try can lead to problems.
# Enter Directory Root
cd /root_dir
# Create Symlink
ln -s public_html tst/public

DevTools Workspace not saving changes to Sass files

I have watched Paul Irish's video of him making changes to CSS in DevTools, which were saved in his local Sass file too. To do that he set up a Workspace in Chrome then used Sass --watch flag with this path: style.scss:style.css.
I have a little bit different file structure than him. I have multiple Sass subfiles, which I import to my main.sccs. Then Sass compiler watches for changes in this file and compiles it to main.css (with a sourcemap by default).
So my file structure look like this:
project's root
|-- index.html
|-- css
|-- main.css
|-- sass
|-- main.scss
|-- theme
|-- _variables.scss
|-- _components.scss
|-- _sctructure.scss
|-- _menu.scss
And to compile Sass files I this path:
sass --watch sass/main.scss:main.css --style compressed
By him all worked well. By myself this works just partially because:
Changes made in Elements Pane are saved just to compiled style.css file on my drive. Sass files stay untouch.
Just changes made direct to Sass files in Sources Pane are saved to my local Sass files and to CSS file as well.
I want to make a change in Elements Pane and have it saved to my Sass files.
I can't make it work. I have tried to put all my styles in a single Sass file (just like Paul: one style.scss file compiled to style.css) but it didn't help. I have also tried to change a path in the Sass compiler and to watch a whole Sass directory. And still nothing. DevTools doesn't save changes made in Elements Pane to Sass files.
Any ideas how it can be achieved? I've looked for additional info on this topic but I didn't found a single solution, which would helped me in this regard.

404 Error while loading fonts

I've my site structure as below
root
|
|-- ProjectDir
|
|-- fonts
| |-- my-webfont.woff
|
|-- css
| |-- vendor
| |-- my-style.css
|
|-- rent.html
In "my-style.css" file, font is linked using a site-root-relative url
url('/fonts/my-webfont.woff')
I use a local webserver to view
http://localhost/ProjectDir/rent.html
But my fonts are not loading and when I try to load
http://localhost/fonts/my-webfont.woff
it shows a 404 Error (File Not Found).
You can see the my git repo here: https://github.com/abhisekp/House-Rent-Calculator and see the fonts/ directory.
And loading the font file using the web server shows 404 Error. See here: https://abhisekp.github.io/fonts/fontawesome-webfont.eot
What's wrong with all this? My local server also behaves this way.
Try using this:
url('../../fonts/my-webfont.woff');
Thanks everyone. I found the bug.
Actually, the problem was the root itself. When viewing using https://abhisekp.github.io/House-Rent-Calculator address, the root is "abhisekp.github.io/" not "abhisekp.github.io/House-Rent-Calculator/" hence the #font-face urls refer to the former rather than the later.
The fonts lies under "House-Rent-Calculator/" directory. I fixed it by using a relative link (safe for everything if "fonts/" & "css/" directories are not changed frequently).
No more root-relative links as I test using various servers and my "House-Rent-Calculator/" directory might be anywhere in the server.
Better be safe than sorry! ;-)

Editing CSS in Gwt WindowBuilder

I am using GWT in a project and recently started using the WindowBuilder in Eclipse. I created a new class and in the WindowBuilder and added some widgets. All that works and everything. However, when I try to edit the CSS for some of the panels and I click to edit the "styleName" field I get an error message which says:
"There are no CSS files referenced from modules HTML."
I've tried adding a link to a style sheet in my base html file and in the Web.gwt.xml file, but that does not seem to work. I get the same error.
In other classes I have used UiBinder and added the style in the XML file, but this class doesn't use UiBinder. So how do I associate a CSS file with the class so that the WindowBuilder allows me to edit the style?
In this project I don't have or use a "war" directory. The project is a couchapp, so I compile it to another directory and push it to CouchDB from there. It seems that in other projects, where there is the original project setup with a war directory, this feature works properly.
I had the same problem and was able to work around it by moving my CSS-resources from the war-directory to the classpath, specifically inside a package that is declared as a "public path" inside the GWT module descriptior via "<public path='...' />".
Project layout (odd location for module descriptor because of Eclipse Plugin Bug):
src
|- main
|- java
| |- demo
| |- client
| | |- MyWidget.java
| | |- MyWidget.ui.xml
| |- Demo.gwt.xml
|- resources
|- demo
|- css
|- Demo.css
Demo.gwt.xml:
<module>
...
<source path="client" />
...
<public path="css" />
<stylesheet src="Demo.css" />
...
</module>
To fix this problem:
In module file gwt.xml type:
<stylesheet src="example.css"/>
Next in menu: Project -> clean.

Resources