Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

scss not compiling #74

Open
Ymx1ZQ opened this issue Apr 5, 2019 · 1 comment
Open

scss not compiling #74

Ymx1ZQ opened this issue Apr 5, 2019 · 1 comment

Comments

@Ymx1ZQ
Copy link

Ymx1ZQ commented Apr 5, 2019

ERROR in ./src/app.vue?vue&type=style&index=0&id=5ef48958&scoped=true&lang=scss& (./node_modules/vue-loader/lib??ref--2!./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=style&index=0&id=5ef48958&scoped=true&lang=scss&)
Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'content' of undefined
    at selectBlock (C:\Users\pc\Desktop\play\essentialfootball\node_modules\vue-loader\lib\select.js:41:13)
    at Object.module.exports (C:\Users\pc\Desktop\play\essentialfootball\node_modules\vue-loader\lib\index.js:79:12)
 @ ./src/app.vue?vue&type=style&index=0&id=5ef48958&scoped=true&lang=scss& 1:0-196 1:212-215 1:217-410 1:217-410
 @ ./src/app.vue
 @ ./src/app.ts

i could not compile scss styles, but I solved by changing how the vue style loader was loaded:

      {
        test: /\.scss$/,
        use: [
          'vue-style-loader',
          'css-loader',
          'sass-loader'
        ]
      }
@pbrach
Copy link

pbrach commented Aug 25, 2019

Yes, I just found the same issue and solution as you. Seems like that option part is not entirely correct:

test: /\.vue$/,
loader: 'vue-loader',
options: {
    loaders: {
        'scss': 'vue-style-loader!css-loader!sass-loader',
        'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax',
    }
}```

and this should be replaced by the code found by @Ymx1ZQ (at least for the SCSS part).

Checking the official vue-loader page I found that the `loader(s)` option is now deprecated (not sure if `loader == loaders`, or a typo? [see options-deprecation](https://vue-loader.vuejs.org/migrating.html#options-deprecation)
In any case: I can't find any documentation for the `loaders` option anymore on the official page: https://vue-loader.vuejs.org/options.html.

And it seems in the current vue-loader (V15) you need to explicitly specify the loader chain for the styles ([see loader-inference](https://vue-loader.vuejs.org/migrating.html#loader-inference))

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

No branches or pull requests

2 participants