scttcper / ngx-toastr

🍞 Angular Toastr
https://ngx-toastr.vercel.app
MIT License
2.52k stars 358 forks source link

Error: Can't resolve '~ngx-toastr/toastr.css' in #1014

Open ankit-1999 opened 7 months ago

ankit-1999 commented 7 months ago

Using angular version 17.0.0 and ngx-toastr version 18.0.0.

getting this error:

./src/styles.scss - Error: Module build failed (from ./node_modules/css-loader/dist/cjs.js): Error: Can't resolve '~ngx-toastr/toastr.css' in

./src/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): HookWebpackError: Module build failed (from ./node_modules/css-loader/dist/cjs.js): Error: Can't resolve '~ngx-toastr/toastr.css' in

openbridge-james commented 7 months ago

I am also getting this problem, but with the version for Angular 15... and ngx-toastr 16...

openbridge-james commented 7 months ago

I was able to get around it by using

@import "./../node_modules/ngx-toastr/toastr.css";

instead of

@import "~ngx-toastr/toastr.css";

geezz07 commented 6 months ago

Does this work, @import "ngx-toastr/toastr.css";

openbridge-james commented 6 months ago

Does this work, @import "ngx-toastr/toastr.css";

No, look at my answer for a fix to the problem