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

scss not compiling #74

Description

@Ymx1ZQ
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'
        ]
      }

Activity

  1. pbrach commented on Aug 25, 2019

    @pbrach

    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 join this conversation on GitHub. Already have an account? Sign in to comment

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