You are reading content from Scuttlebutt
@Soapy mcSoap %1IRlVj5KVf/yDyoTjmmd71PoQ2t4+sP7X02FWLSC7jE=.sha256

Anyone here who works on browser-based SSB clients facing a problem browserifying ssb-client@4.9.0?

I've been doing some work on #patchfox today and it is crashing because it is attempting to actually use fs.mkdtempSync to read a UNIX socket (which is a nonsense for a browser anyway). The errors bubble from client.js in ssb-client:

  // I think it would be better to make these registerable plugins,
  // that got connected up when you called. so they are not hard coded here.

  var ms = MultiServer([
    [Net({}), shs],
    [Onion({}), shs],
    [WS({}), shs],
    [UnixSock({}), noauth],
    [Net({}), noauth]
  ])

It is that UnixSock line. This was not happening before. I have no idea what happened.

@Soapy mcSoap %LSKxI1Hhlm0M9OA5S3+o7ir4ZygwNEIDjbdPIP/OohE=.sha256

Yep, if I comment out that UnixSock line directly on the file inside node_modules, then it all works well.

Argh.

Trying to think what is the best way to fix this. I've tried a couple of modules that stub out the fs.* functions but they only work on your own source files, not inside the files from node_modules/. This is trickier than it seems. What is really strange is that this was not happening before and as far as I can tell, that UnixSock line has been there since 2019. So how come the Patchfox build worked in 2020?! I have no idea.

@Soapy mcSoap %uqUkCW3uN320KCNnuOwrilUFQHiNhitvLGyHuSZAjWk=.sha256

Apparently, I can't fix this. Browserify protects my code by ignoring my request to replace fs with my-fake-fs for the dependencies, so I can't use ssb-client because it tries to use multiserver with a unix socket plugin.

If browserify allowed me to replace fs.* with my return "fuck this shit version, then everything would just work.

I'm so tired of the nodejs ecosystem... It is that kind of friction that makes me move away from development.

@Soapy mcSoap %QOiifnaTl9ITv62VZAQUc48uM2PhwvAzklZPN+wfbrc=.sha256

So, a recap. Went to the ESC meeting today and was excited for SSB stuff.

decided to implement some small fixes on Patchfox and a new feature. Noticed that some of the packages were getting pretty old. Updated them. Lost more than three hours just trying to get things building again. Shit still not working because of the problems above on this thread.

No energy whatsoever to develop stuff with the js stack people use these days, so many layers of indirection and transformation makes it as fragile as hell.

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@Soapy mcSoap %exc6oH4n9vZ7WAReonKZfRupYkiAHTeMSpt4X/OXSis=.sha256

So....

this is kind of a #rant.

I deleted node_modules. Installed it all again with npm i, and run the npm run clean-dev script, which is Patchfox's script to do a clean development build. It worked. It is working.

What did I change between this and the version that was broken? NOTHING.

What does that means? That NodeJS projects are kinda not reproducible. You can end up with a shit problem due to the fractal transpilation that is happening everywhere without any clue why you got there.

@Soapy mcSoap %M2nl2wyap//1XsUCFZtzja9EAynqgBR2aWHim9IDYLQ=.sha256

Now, maybe I can fix some bugs...

@Soapy mcSoap %dF8VkTTh6n+aYGZQzXnjKDpzH6f/8ML7c4s8xmYfCoA=.sha256

omg, with the new glasses I can see patchfox in a totally new light. It actually looks good.

@Soapy mcSoap %7rW7l6RwJBVzHmcU4QD+s6WHya5Dl1Lxry+E7j01pK4=.sha256

image.png

Fuck this shit. I just issued a rebuild and the problem reappeared. 😿 And no, I didn't came near any code related to that, I'm tweaking CSS on a svelte component.

@Soapy mcSoap %hzPC5H37ynnGqKSVJK8OJMyrKrJmjlwNG7BxFayikSg=.sha256

Oh, and between this message and this error there were at least five builds without any hiccups. I was just quiet patching stuff, and then that shit reappeared.

I wish I knew the status of other SSB stacks better, I'd love to switch to some other language even if it has fewer features.

@Soapy mcSoap %uYYAZp5paIaEMLvcM/902iLdOF5GqFY6zkLqEFW8sAc=.sha256

I'm beginning to suspect I'll need to fork ssb-client :-/

@Soapy mcSoap %4eR3+m4a6TVAOggVYMbz7EyUoKTmDXgBkVWuLsT9Hf0=.sha256

yep, I forked it into soapdog/ssb-client-for-browser. I just need it to work so that I can keep working on patchfox. After replacing it with the fork, the build worked, and I'm using patchfox to compose this reply.

Join Scuttlebutt now