Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature module @import "@spartacus/styles/index" ERROR #19907

Open
Adam-Michalski opened this issue Jan 21, 2025 · 2 comments
Open

Feature module @import "@spartacus/styles/index" ERROR #19907

Adam-Michalski opened this issue Jan 21, 2025 · 2 comments

Comments

@Adam-Michalski
Copy link

Adam-Michalski commented Jan 21, 2025

How to include spartacus styles to use extends and include in feature module lib

Describe the bug
Feature module @import "@spartacus/styles/index" causes ERROR: Could not resolve "@ng-select/ng-select/themes/default.theme.css"

Tell us the version of Spartacus

  • Library version: ~2211.25.1

To Reproduce
Steps to reproduce the behavior:
Use in any style file import
@import "@spartacus/styles/index";

Expected behavior
Ability to extend spartacus classes without error
ERROR: Could not resolve "@ng-select/ng-select/themes/default.theme.css"
The path "./themes/default.theme.css" is not currently exported by package "@ng-select/ng-select":

Screenshots

Image

Additional context
I have tried

   "styleIncludePaths": [
      "../../node_modules/@ng-select/ng-select/themes/default.theme.css"
    ]

And importing it directly in scss file but it does not fix this error

@Fred9099
Copy link

Fred9099 commented Jan 21, 2025

Hi, try adding

"stylePreprocessorOptions": {
   "includePaths": ["node_modules/"]
 }

In the "build" and "build-dev" (if you have it/use it) steps as a default option independent from any configuration, like so:
Image

This will tell to look in the node_modules for that style import or others starting with the @ during build process

@Adam-Michalski
Copy link
Author

Hi, try adding

"stylePreprocessorOptions": {
   "includePaths": ["node_modules/"]
 }

In the "build" and "build-dev" (if you have it/use it) steps as a default option independent from any configuration, like so: Image

This will tell to look in the node_modules for that style import or others starting with the @ during build process

In library I do not have stylePreprocessorOptions

I do have option in lib-repo/projects/library/ng-package.json

    "styleIncludePaths": [
      "../../node_modules/@ng-select/ng-select/themes/default.theme.css"
    ]

It does not solve issue

I have created styles.scss with above import and included it in styleIncludePaths it did not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants