Skip to content

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

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

Closed
pixeloution opened this issue Jun 28, 2022 · 5 comments
Closed

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

pixeloution opened this issue Jun 28, 2022 · 5 comments
Labels

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
Collaborator

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

1 similar comment
@carsonbot
Copy link
Collaborator

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

@carsonbot
Copy link
Collaborator

Friendly ping? Should this still be open? I will close if I don't hear anything.

@carsonbot
Copy link
Collaborator

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

@carsonbot carsonbot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants