Skip to content

there is an bug on scss import #157

@yozman

Description

@yozman

hey guys,
I installed node-sass, sass-loader to use sass in my project,
but when I try to use primer-markdown, there is an Bug

ERROR in ./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=_v-bb18f99e&scoped=true!./~/sass-loader?indentedSyntax!./~/vue-loader/lib/selector.js?type=style&index=0!./src/components/widget/Article.vue
Module build failed: 
@import "primer-support/index.scss";
^
      File to import not found or unreadable: primer-support/index.scss
Parent style sheet: /Users/yozman/sysc/node_modules/primer-markdown/index.scss
      in /Users/yozman/sysc/node_modules/primer-markdown/index.scss (line 1, column 1)
 @ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=_v-bb18f99e&scoped=true!./~/sass-loader?indentedSyntax!./~/vue-loader/lib/selector.js?type=style&index=0!./src/components/widget/Article.vue 4:14-298 13:2-17:4 14:20-304

the code is like

// Article.vue
<template lang="jade">
  div(:class.once="$options.name" v-html="innerHTML")
</template>

<script>
export default {
  data () {
    return {
      innerHTML: ''
    }
  },
  name: 'W__Article',
  props: { args: Object },
  watch: {
    'args.content' (val) {
      let scoped = this.$el.attributes[0].name
      this.innerHTML = val.replace(/(<[^/]+?)([> ])/g, `$1 ${scoped}$2`)
    }
  }
}
</script>

<style lang="sass" scoped>
@import ~primer-markdown/index.scss

.W__Article
  @extend .markdown-body
</style>
// node_modules/primer-markdown/index.scss
@import "primer-support/index.scss";
@import "./lib/markdown-body.scss";
@import "./lib/headings.scss";
@import "./lib/lists.scss";
@import "./lib/tables.scss";
@import "./lib/images.scss";
@import "./lib/code.scss";

when I change it to @import "~primer-support/index.scss" it works.

how can I fix it to works on my project?

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