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

module build failed #6

Closed
harpagon210 opened this issue Jan 14, 2018 · 7 comments
Closed

module build failed #6

harpagon210 opened this issue Jan 14, 2018 · 7 comments
Assignees

Comments

@harpagon210
Copy link

Hi,

I have the following error when webpack tries to build my app:

$slider-radius: $radius !default
               ^
      Undefined variable: "$radius".
      in ....../node_modules/bulma-slider/slider.sass (line 1, column 17)
 @ ../node_modules/bulma-slider/slider.sass 4:14-92

Any idea of what is wrong?
Do I have to import another module?

@Wikiki Wikiki self-assigned this Jan 14, 2018
@Wikiki
Copy link
Owner

Wikiki commented Jan 14, 2018

Hi @harpagon210,

did you import Bulma first ?
If yes, you have to import bulma first or use bulma-slider.sass file instead of slider.sass

rehgards

@harpagon210
Copy link
Author

harpagon210 commented Jan 14, 2018

Hi thanks for your quick reply ;)

Yes, here is my imports:

import 'bulma'
import 'bulma-slider'

and my webpack-config

{
        test: /\.scss$/,
        use: [{
            loader: "style-loader" // translates CSS into CommonJS
        },{
            loader: "css-loader" // translates CSS into CommonJS
        }, {
            loader: "sass-loader" // compiles Sass to CSS
        }]
      },
      {
        test: /\.sass$/,
        use: [{
            loader: "style-loader" // translates CSS into CommonJS
        },{
            loader: "css-loader" // translates CSS into CommonJS
        }, {
            loader: "sass-loader" // compiles Sass to CSS
        }]
      },

thanks

@harpagon210
Copy link
Author

harpagon210 commented Jan 14, 2018

@Wikiki there is no bulma-slider.sass in the node-modules/bulma-slider folder ;)

I installed it via

npm install bulma-slider

@Wikiki
Copy link
Owner

Wikiki commented Jan 14, 2018

Weird.

Can you try with this:

@import 'bulma/sass/utilities/_all'
@import 'bulma-slider'
@import 'bulma'

@harpagon210
Copy link
Author

harpagon210 commented Jan 14, 2018

@Wikiki I have the same error :(
I import via my javascript code, is that a problem? (I'm not used to webpack yet so I might be importing the files the wrong way...)

my js file:

import 'bulma/sass/utilities/_all.sass'
import 'bulma-slider/slider.sass'
import 'bulma/css/bulma.css'

@Wikiki
Copy link
Owner

Wikiki commented Jan 14, 2018

You need to create a sass file in which you import files:

@import '~/bulma'
@import '~/bulma-slider'

you can't import sass (or css) files into JS.

@harpagon210
Copy link
Author

Thanks for your answer, what I did to fix the problem is that I created a sass file like you said.
I was supposed to be able to load css files through webpack in my js but nevermind, I have to learn more about webpack I guess as I'm probably doing something wrong...

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

No branches or pull requests

2 participants