"<stream>:1:1": proto: cannot parse invalid wire-format data

Hello,

I recently started to see this error after upgrading to the latest version 0.123.4. I’ve confirmed on an older version running 0.99 where I do not see the same error while serving the same project files. Is it possible that a recent update might have caused this? Maybe there is something I need to update in my Hugo files, or possibly an issue with DartSASS? Thank you for looking.

ERROR TOCSS-DART: failed to transform "/scss/styles.scss" (text/x-scss): "<stream>:1:1": proto: cannot parse invalid wire-format data

BTW, I do not have a public repo.

Please post the output from hugo env.

Hello @jmooring, here you go.

hugo v0.123.4-21a41003c4633b142ac565c52da22924dc30637a+extended darwin/amd64 BuildDate=2024-02-26T16:33:05Z VendorInfo=brew
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"

You need to install Dart Sass.

https://gohugo.io/functions/resources/tocss/#dart-sass

Hello, I believe I see part of the problem. I have dart sass embedded installed which it looks like it only works up to 0.114. Confirmed by running which sass. /usr/local/bin/sass

Sounds like that is the outdated way of installing dart sass. I’m guessing I should delete that bin folder now?

I do have sass installed via Brew, but it’s unclear if it is dart sass. Is that the libsass that is showing in the env output?

The libsass entry reports Hugo’s embedded libsass library.

If Dart Sass were installed, embedded or not, it would show up when you run hugo env.

I recommend you uninstall all instances of Sass, install Dart Sass per the documentation that I linked to above, and test that it’s in your path by typing “sass --embedded --version” from the command line. The current version of Dart Sass is 1.71.0.

Thank you for your help. I realize my next question is not Hugo related, but would appreciate any insight you might have. Currently, I’m unable to install the latest version of Dart Sass. And without the correct Dart SDK, I’m unable to install Dart Sass.

The current Dart SDK version is 2.18.6.

Because sass requires SDK version >=3.0.0 <4.0.0, version solving failed.

It’s unclear why, but when I install Dart through Brew it will only install 2.18.6. I’m unable to upgrade to the latest version above 3.0 that the error asks for. I’ve attempted to uninstall Dart and it still shows as installed. There appears to be no way to completely clear out the old version. Any thoughts on that?

I’m now noticing odd behavior after uninstalling Sass and Dart with Brew. You can see that Hugo is referencing Dart Sass Embedded which it wasn’t earlier.

hugo v0.123.4-21a41003c4633b142ac565c52da22924dc30637a+extended darwin/amd64 BuildDate=2024-02-26T16:33:05Z VendorInfo=brew
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
github.com/sass/dart-sass-embedded/protocol="1.0.0"
github.com/sass/dart-sass-embedded/compiler="1.52.1"
github.com/sass/dart-sass-embedded/implementation="1.52.1"

I would like to remove the embedded version to align with the Hugo requirement. The problem is I don’t remember how I installed embedded other than including it in a bin folder. I vaguely remember having to change the $PATH somewhere on my system to reference this.

Way back then, I think the only way you could have installed it was by manually placing the bin file in one of the directories listed in your PATH environment variable, or perhaps you created new directory that you then added to your PATH environment variable.

Look at your PATH environment variable; that may give you a clue.

Or run

which dart-sass-embedded

Yeah, I see the folder path in Finder with the embedded files. Is it ok to manually delete that folder? If so, do I need to remove the reference in $PATH? Whenever I try to install the newer version of Sass it still wants to reference that embedded version.

What’s the full path to the directory?
What files are in the directory?

No, but you should.

That’s due to the order of entries in your PATH environment variable.

Full path is /Users/burtcrismore/bin/sass_embedded

Files inside the directory.

I would like to remove the path. I’ve been searching and the closest thing I can find is something about export $PATH. Do you know what the entry would be to remove the full path above?

Thank you for your help.

Yes, you can safely remove the sass_embedded directory.

Given the nature of your questions, I am uncomfortable describing how to modify your PATH. You could easily do some damage and I don’t want to be the cause of that. I suggest you leave the PATH variable as is, or investigate on your own how to modify it.

Sure, I understand. If I remove the files but leave the directory, will I be able use other versions of Sass or will it keep referencing embedded because of that $PATH?

The PATH environment variable is a list of directories (entries) that the operating searches when looking for an executable. Non-existent paths are ignored.

Got it. Any idea why I’m unable to upgrade Dart SDK beyond 2.18.6? I keep getting this error when I try to install Dart Sass from Brew.

The current Dart SDK version is 2.18.6.

Because sass requires SDK version >=3.0.0 <4.0.0, version solving failed.

I can’t force an upgrade to Dart Sass either. This is what is available in the Brew Formulae.

No option for Dart SDK above 3.0. Dart Sass fails to install while my Dart SDK is below the version requirement.

I figured out the problem related to installing Dart Sass as mentioned above. Here’s the answer for those interested.

If you receive the message Warning: dart-lang/dart/dart 2.18.6 already installed there are a couple of steps you must take.

  1. Run brew update
  2. If prompted run brew tap --repair
  3. Run brew update again
  4. Brew will find outdated formulae
  5. Upgrade by running brew upgrade

This forced all version to be up to date where as before it would never upgrade past 2.18.6, which means Sass would continually fail.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.