nprogress icon indicating copy to clipboard operation
nprogress copied to clipboard

Failed to find '~nprogress/nprogress.css' after use postcss-import

Open iliuyt opened this issue 6 years ago • 12 comments

1、vue init webpack test 2、npm install nprogress 3、edit main.js

import NProgress from 'vue-nprogress'

...
...

new Vue({
nprogress: new NProgress({
    parent: '.nprogress-container'
}),

..........

}).$mount('#app')

4、edit App.vue

import NprogressContainer from 'vue-nprogress/src/NprogressContainer'
.....

export default {
    name: 'app',
    components: {
        NprogressContainer
    }
    ....
}

5、npm run dev

ERROR

Module build failed: Error: Failed to find '~nprogress/nprogress.css'

iliuyt avatar Dec 25 '17 04:12 iliuyt

Facing the same problem.

dev1337 avatar Jan 06 '18 20:01 dev1337

same here

qgliu avatar Jan 08 '18 06:01 qgliu

Fixed it by going to the original Nprogress repository and take the .css file from there.

dev1337 avatar Jan 08 '18 14:01 dev1337

Same erro here, it is a problem.

alexsandro-xpt avatar Jan 14 '18 19:01 alexsandro-xpt

Same issue here.

rmotzko avatar May 12 '18 22:05 rmotzko

it works ,if you use vue-cli ,just npm i -D stylus-loader , or you should add stylus-loader in webpack.config.js ,

asyalas avatar Jul 29 '18 07:07 asyalas

I don't remember how I fix this issue, but only diff thing I see is that now, I import it like that import NProgress from 'vue-nprogress';

alexsandro-xpt avatar Jul 30 '18 15:07 alexsandro-xpt

Yep I also have the same issue and I didn't figured it out, how to solve it...

stefanDeveloper avatar Aug 02 '18 08:08 stefanDeveloper

For those like me who didn't manage to get this working, there is a pretty neat plug-and-play alternative progress bar for vue: https://github.com/hilongjw/vue-progressbar#vue-router

gabfr avatar Aug 08 '18 15:08 gabfr

I fixed mine by removing the tilde(~) from the NProgressContainer import of nprogress/nprogress.css. I guess the developer was using a MAC.

DominusKelvin avatar Oct 12 '18 10:10 DominusKelvin

You can fix it by importing the css file:

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

etobdc avatar Sep 29 '21 18:09 etobdc

I have this working in my app.css file: @import "~nprogress/nprogress.css";

faiyazalam avatar Jan 19 '23 06:01 faiyazalam