mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.72k stars 864 forks source link

Can't import angular-calendar SASS files in an Angular project v15 #1627

Closed LoganDupont closed 1 year ago

LoganDupont commented 1 year ago

Describe the bug

Can't import library SASS files in an Angular project. Getting the following error:

./apps/home/src/css/main.scss - Error: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Package path ./css/angular-calendar.css is not exported from package <Path>\node_modules\angular-calendar (see exports field in <Path>\node_modules\angular-calendar\package.json)

./apps/home/src/css/main.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: Package path ./css/angular-calendar.css is not exported from package <Path>\node_modules\angular-calendar (see exports field in <Path>\node_modules\angular-calendar\package.json)

https://github.com/angular/angular-cli/blob/main/CHANGELOG.md#angular-devkitbuild-angular-4 In @angular/cli v15.0.0 Deprecated support for tilde import has been removed. Please update the imports by removing the ~

What should we use now?

Minimal reproduction of the problem with instructions

Create an empty Angular project that imports the SASS file in the app styles.scss by using:

@import 'angular-calendar/css/angular-calendar.css'

Versions

matts-bot[bot] commented 1 year ago

Thanks so much for opening an issue! If you'd like to support this project, then please consider sponsoring me

mattlewis92 commented 1 year ago

Hi there!

I tried to reproduce your issue but was unable to following your instructions: https://github.com/mattlewis92/angular-15-angular-calendar/blob/main/src/styles.scss

Please can you make a minimal repro on github that shows your problem, thanks!

LoganDupont commented 1 year ago

I just had a better look at it seems that I did @import 'angular-calendar/css/angular-calendar.css' instead of @import 'angular-calendar/scss/angular-calendar'.

mattlewis92 commented 1 year ago

OK great, will close this out then!