FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 922 forks source link

[BUG] using an array for loadPath in Sass breaks the build with fatal error #2824

Closed segovia94 closed 3 years ago

segovia94 commented 3 years ago

This was already reported and fixed in #2547, but for some reason it was closed without being merged. That PR should be re-opened and merged to fix this.

Tested on build edef1986673d6049913315308f669eb67fe40c52.

plugins: [
  ['@snowpack/plugin-sass', {
    compilerOptions: {
      loadPath: [
        'node_modules',
        'node_modules/breakpoint-sass/stylesheets',
        'node_modules/sass-toolkit/stylesheets',
      ],
    },
  }],
],

Throws a fatal error because it incorrectly passes the extra --load-path parameters as --l

UnhandledPromiseRejectionWarning: Error: Command failed with exit code 64:sass --stdin --load-path /my-project-path/sass --l=o --l=o --l=o Could not find an option named "l".

fgblomqvist commented 3 years ago

I'm also hitting this, sounds like it would take less than a minute to fix it since the MR is already there.

mrkmiller commented 3 years ago

I see the "needs-reproduction" tag was added. Anything in particular that is being expected to reproduce? Check out the @snowpack/plugin-sass at edef1986673d6049913315308f669eb67fe40c52 or the current head and add the following to the snowpack.config.js

plugins: [
  ['@snowpack/plugin-sass', {
    compilerOptions: {
      loadPath: [
        'node_modules',
        'any_other_path',
      ],
    },
  }],
],

Then run snowpack dev.

The following error will appear.

UnhandledPromiseRejectionWarning: Error: Command failed with exit code 64:sass --stdin --load-path /my-project-path/sass --l=o --l=o --l=o Could not find an option named "l".

2547 just needs to be reopened and merged to fix this.

melissamcewen commented 3 years ago

@mrkmiller hi! yeah that tag means I need something to test against, ideally a repo with the code I can run on my machine. I can make one myself or if you have one that would be good. I'll talk to the team about reopening that.

melissamcewen commented 3 years ago

Good news! I talked to the other maintainers and we merged it! Please reopen if it's still buggy. Thanks for bringing this up.