Wordpress: Issue registering/enqueueing style sheet - wordpress

New to wordpress and I can't get stylesheets to load in my plugin. Either that or thier effects are being overridden. This is what I have in my main plugin.php file:
function load_pc_scripts() {
wp_register_style('plugin-style', plugin_dir_url(__FILE__) . 'plugin-style.css');
wp_enqueue_style('plugin-style');
}
add_action('wp_enqueue_scripts', 'load_pc_scripts');
The style sheet is in the same directory but console shows this:
plugin-style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:8 JQMIGRATE: Migrate is installed, version 1.4.1
plugin-style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
options-general.php?page=price-compare-settings:1 Unchecked runtime.lastError: The message port closed before a response was received.
plugin-style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)

If the console is showing a 404 then enqueue is working, you likely have a typo in the file name or party in one place or another

Related

NestjS - Swagger ui css resource not found in production mode

I am working on a nestjs project, I've added swagger to display my endpoints, It's working great in dev mode, but once deployed in production using https://zeit.co/ (now), the endpoints page is not displayed correctly (the css is missing), I got in the network tab this error:
/favicon-32x32.png:1 Failed to load resource: the server responded with a status of 404 ()
/favicon-16x16.png:1 Failed to load resource: the server responded with a status of 404 ()
swagger-ui.css:1 Failed to load resource: the server responded with a status of 404 ()
https://i.stack.imgur.com/T9IQv.png
Thanks.
I had a similar issue and I have shared the solution here:
https://stackoverflow.com/a/74708365/13701992
Please check If it answers your question
You will need to provide additional options in SwaggerModule.setup method:
import { DocumentBuilder, SwaggerModule } from '#nestjs/swagger';
// some code...
const options = new DocumentBuilder()
.setTitle('Your title')
.setDescription('Your description')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api', app, document, {
customCssUrl: 'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.15.5/swagger-ui.min.css',
});

Failed to load resource: the server responded with a status of 404 (Not Found) issue for Kendo dll files

When I run my Asp.Net MVC web page it shows the following error in browser console.Here I use BundleConfig for load Js files.
http://localhost:59574/Verification/Content/kendo/kendo.common.min.css - Failed to load resource: the server responded with a status of 404 (Not Found)

wamp, roots.io/sage, kirki and path

I use the starter theme roots.io/sage and kirki for theme customizer on windows 10 with wampserver.
I have a problem with the path used by kirki :
[code]
Failed to load resource: the server responded with a status of 403 (Forbidden)
http://localhost:3000/www.site.fr/wp-content/themes/siteC:wampwwwwww.site.frwp-contentthemessitelibkirki/assets/js/kirki-tooltip.js?ver=4.3.1
[/code]

Famo.us grunt serve gives blank browser

Trying to start playing with the Famo.us example. I followed the steps on the Github page and when I do "grunt serve" the browser opens up but with the following errors:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous-polyfills/functionPrototypeBind.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous-polyfills/classList.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous/core/famous.css
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous-polyfills/requestAnimationFrame.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/requirejs/require.js
Running it on Windows 7 with Chrome. Any idea how to solve this?
Have you tried running "bower install"? All of those dependencies should be installed by default via bower when you run 'yo famous', but I have seen some instances where it does not.
I would ignore the above advice about cloning via github, there are other dependencies including require.js and almond that would not be installed using that method
Also, as far as minified version is concerned... if you run the "grunt" command you will have a minified, cache busted version of all your dependencies roll for you via require.js / almond. This is better than simply having a minified version of the library as it will only link in modules used.
FWIW I am the author of the tool :D
Based on your comment.. If those files do not exist, you need to make them exist. It is strange the files were not created using the ToolBelt.
Just go to github and grab the files you are missing.
famous/core : https://github.com/Famous/core
famous-polyfills : https://github.com/Famous/polyfills
requirejs: https://github.com/Famous/examples/tree/master/src/lib
** EDIT **
The Author of this tool has submitted a better answer.. Please read TheAlphNerd's response.

Unable to load another page in JHipster on Production

I have an issue with the Pprod profile. I have created two pages: index.html and profile.html
When I run the project with production profile then the index page is working fine for me. I.e. it converts all CSS, JS and replaces all HTML with the new URL.
If I replace profile.html with index.html then again it is all working fine for me. I.e. it converts all CSS, JS and replaces all HTML with the new URL.
But, if I run both pages simultaneously, then only index.html is working fine for me and profile.html is not.
On profile.html page HTML, the URL is not changed with script.js and main.css file.
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/styles/postLogin.css
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/main.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/app/app.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/directive/profile-directive.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/controller/profile-controller.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/service/profile-service.js
Any ideas?
Thanks in advance.
First you need to upgrade to our latest 0.8.3 version, which I just released 2 minutes ago. It fixes several issues in "production" mode, which probably affect you:
http://jhipster.github.io/2014/01/29/jhipster-release-0.8.3.html
Secondly, your main problem is that JHipster is designed to create a "single page" webapp, so obviously if you have two Web pages you will have some minor trouble. The only thing you need to do, AFAIK, is to add your file to the WebConfigurer.initStaticResourcesProductionFilter class, just after the "/index.html" line:
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/profile.html");
That way your file will be served by the "production" filter.

Resources