Skip to content

SCSS file: can't find stylesheet to import #737

@greefhorst

Description

@greefhorst

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch bootstrap-switch@3.4.0 for the project I'm working on.

The bootstrap-switch.scss has two broken import statements, refering to bootstrap-4.2.1.

Error: Can't find stylesheet to import.
   
14  @import "../bootstrap-4.2.1/functions";
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   
  node_modules/bootstrap-switch/src/sass/bootstrap4/bootstrap-switch.scss 14:9  @import

This can be fixed by adding bootstrap to your package.json requirements and applying the following patch.

Here is the diff that solved my problem:

diff --git a/node_modules/bootstrap-switch/src/sass/bootstrap4/bootstrap-switch.scss b/node_modules/bootstrap-switch/src/sass/bootstrap4/bootstrap-switch.scss
index 63d9951..715c631 100644
--- a/node_modules/bootstrap-switch/src/sass/bootstrap4/bootstrap-switch.scss
+++ b/node_modules/bootstrap-switch/src/sass/bootstrap4/bootstrap-switch.scss
@@ -11,8 +11,8 @@
 $bootstrap-switch-border-radius: 4px;
 $bootstrap-switch-handle-border-radius: 3px;
 
-@import "../bootstrap-4.2.1/functions";
-@import "../bootstrap-4.2.1/variables";
+@import "bootstrap/scss/functions";
+@import "bootstrap/scss/variables";
 
 .bootstrap-switch {
 	display: inline-block;

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions