anteriovieira / nuxt-sass-resources-loader

SASS resources (e.g. variables, mixins etc.) module for NuxtJs
https://www.npmjs.com/package/nuxt-sass-resources-loader
185 stars 15 forks source link

TypeError: sassLoader.oneOf is not iterable #23

Open nataliawww opened 6 years ago

nataliawww commented 6 years ago

Using nuxt-sass-resources-loader 2.0.5 with Nuxt 2.0.

modules: [
    'nuxt-sass-resources-loader'
],
sassResources: [
    './assets/scss/abstracts/variables.scss'
],

Trying to set up the nuxt.config.js and running into the error on run dev

TypeError: sassLoader.oneOf is not iterable

Silverman42 commented 6 years ago

I am equally experiencing the same issue. The resource loader worked pretty fine when i was using nuxt 1.0. Does the upgrade of webpack to v4 in Nuxt 2.0 have something to do with this issue.

nataliawww commented 6 years ago

I found that my issue is linked to the includePaths option in sass-loader.

Removing this part of my config fixed it.

test: /\.(scss)$/,
loader: 'sass-loader',
options: {
  includePaths: ['~/assets/styles/']
}

Would of course be nice to use both at the same time.

Also I had to include the resources loader like this:

 modules: [
    ['nuxt-sass-resources-loader', [
      path.resolve(__dirname, 'assets/styles/config/*.scss')
    ]]
  ]

@Silverman42 Maybe this helps!