uswds / uswds-gulp

A simple Gulp 4.0 workflow for transforming USWDS Sass into browser-readable CSS.
Other
35 stars 17 forks source link

TypeError: sass.sync is not a function #36

Closed bsang closed 3 years ago

bsang commented 3 years ago

I keep getting the following error when I run gulp or gulp watch. Please help!

[00:05:40] Starting 'watch'... [00:05:40] Starting 'build-sass'... [00:05:40] 'build-sass' errored after 6.11 ms [00:05:40] TypeError: sass.sync is not a function at /Users/ling/Sites/glbc/web/themes/custom/glbc/gulpfile.js:104:14 at build-sass (/Users/ling/Sites/glbc/web/themes/custom/glbc/node_modules/undertaker/lib/set-task.js:13:15) at bound (domain.js:427:14) at runBound (domain.js:440:12) at asyncRunner (/Users/ling/Sites/glbc/web/themes/custom/glbc/node_modules/async-done/index.js:55:18) at processTicksAndRejections (internal/process/task_queues.js:79:11) [00:05:40] 'watch' errored after 7.81 ms

mejiaj commented 3 years ago

@bsang can you share the steps you went through to produce this error and share the dependencies and devDependencies from your package.json file?

bsang commented 3 years ago

It's working after added (require('sass') to the sass variable. const sass = require("gulp-sass")(require('sass'));

I run into another issue, but this is more like uswds has to fix the issue: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

bsang commented 3 years ago

For DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. I install sass 1.32.6 instead of the latest version and fixed the issue for now.

npm i sass@1.32.6

mejiaj commented 3 years ago

Thanks for reporting this.

I'll create a PR based on the information now that I've confirmed the issue and fix. Next time, feel free to create a PR!