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

Build error when using scoped style and Stylus #112

Open
theoribeiro opened this issue May 22, 2020 · 2 comments
Open

Build error when using scoped style and Stylus #112

theoribeiro opened this issue May 22, 2020 · 2 comments

Comments

@theoribeiro
Copy link

Whenever I use a scoped style that has specific Stylus grammar like '/' for comments, I get a build error such as

Module build failed (from ./node_modules/vue-loader/lib/loaders/stylePostLoader.js):
Error: Unexpected '/'. Escaping special characters with \ may help.
    at Root._error (/app/node_modules/postcss-selector-parser/dist/parser.js:160:16)
    at Root.error (/app/node_modules/postcss-selector-parser/dist/selectors/root.js:43:19)
    at Parser.error (/app/node_modules/postcss-selector-parser/dist/parser.js:726:21)
    at Parser.unexpected (/app/node_modules/postcss-selector-parser/dist/parser.js:744:17)
    at Parser.combinator (/app/node_modules/postcss-selector-parser/dist/parser.js:642:12)
    at Parser.parse (/app/node_modules/postcss-selector-parser/dist/parser.js:1081:14)
    at Parser.loop (/app/node_modules/postcss-selector-parser/dist/parser.js:1023:12)
    at new Parser (/app/node_modules/postcss-selector-parser/dist/parser.js:150:10)
    at Processor._root (/app/node_modules/postcss-selector-parser/dist/processor.js:55:18)
    at Processor._runSync (/app/node_modules/postcss-selector-parser/dist/processor.js:102:21)
    at Processor.processSync (/app/node_modules/postcss-selector-parser/dist/processor.js:199:23)
    at rewriteSelector (/app/node_modules/@vue/component-compiler-utils/dist/stylePlugins/scoped.js:65:12)
    at Root.each (/app/node_modules/postcss/lib/container.js:101:16)
    at /app/node_modules/@vue/component-compiler-utils/dist/stylePlugins/scoped.js:16:10
    at LazyResult.run (/app/node_modules/postcss/lib/lazy-result.js:295:14)
    at LazyResult.sync (/app/node_modules/postcss/lib/lazy-result.js:281:26)

As soon as the style isn't scoped anymore I don't have any trouble. That also doesn't happen if I'm not using style-resources-module.

My nuxt.config.js:

...
modules: [ ..., '@nuxtjs/style-resources', ... ],
...
styleResources: {
    stylus: ['~assets/style/main.styl']
  },
...

My guess is that Webpack is using a different loader when I have a scoped style tag but I don't know how I could verify or fix that.

@arbisyarifudin
Copy link

i have same issue

@kayw-geek
Copy link

Has the problem been solved?

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

No branches or pull requests

3 participants