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

Specifying options.loaders.scss|sass for vue-loader fails to work #1130

Open
pixeloution opened this issue Jun 28, 2022 · 2 comments
Open

Specifying options.loaders.scss|sass for vue-loader fails to work #1130

pixeloution opened this issue Jun 28, 2022 · 2 comments

Comments

@pixeloution
Copy link

I'm not nearly a webpack expert but I've copied some config info from the VueJS website and I'm adding some configuration via Encore as follows:

.enableVueLoader(options => {
  options.loaders = {};
  options.loaders.scss = "vue-style-loader!css-loader!sass-loader";
  options.loaders.sass = "vue-style-loader!css-loader!sass-loader?indentedSyntax";
 }, { runtimeCompilerBuild : false })

This should enable both sass and scss syntax in a vue file, ie.

<style lang="scss">
.rule {
  width : 100px;
}
</style>

<style lang="sass">
.rule
  width : 100px
</style>

The actual error received is:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: expected "{".

Which indicates its only accepting the SCSS syntax not the SASS (indented, no braces) syntax. The default behavior for node-sass is to allow either syntax based on file extension -- and I've validated that works properly.

@stevenroh
Copy link

stevenroh commented Sep 28, 2022

Hi,

Not sure it's related but I got the same error (SassError: expected "{".) inside <style lang="sass">.

To solve this, I specified the indentedSyntax like this (on the sass loader) :

.enableSassLoader(options => { 
   options.sassOptions.indentedSyntax = true;
})

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

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