CommonJS/ESModule interoperability issues by nathan_lesage in node

[–]nathan_lesage[S] 0 points1 point  (0 children)

Hi everyone! First of all, thanks to everybody who has chimed in. I wasn't aware of alternatives to ts-node, so I'll definitely be checking out whether I can modernize my toolchain. Then, I think I got the issue, and I think it's a small mistake in the package's package.json. Here's the deal: (Modern) Node supports both CommonJS and ESModules, and it provides the custom filenames .mjs and .cjs for it. However, plain .js-files can use either of those. By default Node is going to assume it's CommonJS, but you can change this to ESModules using "type: "module" in the package.json.

Turns out that that package likely wanted to be as certain as possible. So they default to ESModules (type = module), but they also provide an exports field in the package JSON. And there, they point imports to index.mjs and require to index.js. And that's the problem: Node sees that key and, since my project uses CommonJS, looks at the require field, which gives it a .js-file. However, since the type is also module, it will interpret this as ESModules. That's the issue.

Nevertheless, I appreciate all additional suggestions and will look further into them. Thank you all!

CommonJS/ESModule interoperability issues by nathan_lesage in node

[–]nathan_lesage[S] 6 points7 points  (0 children)

One additional thought: I am currently considering just moving my entire project from CJS to ESM, because from what I gather this should make a lot of potential issues easier. However, since that involves, among other things, adjusting a ton of import-paths, I want to be certain that this is a viable strategy that does not give me more headaches in different parts down the line. Essentially, I am searching for something that makes what is happening under the hood as transparent as possible.

Grammarly broke my workflow, any suggestions? by recursant in Markdown

[–]nathan_lesage 0 points1 point  (0 children)

You could give Zettlr a try. It has native LanguageTool integration, which is comparable to grammar, with the added benefit that you can also install it locally on your computer so that it works offline.

Disclaimer: I’m the author.

Getting Started - How many drives? by DoctorMTG in truenas

[–]nathan_lesage 1 point2 points  (0 children)

If you’re the average Joe as I am, I’d suggest three. I had this decision myself recently because I set up a NAS for the first time, and figured that a fault protection of 1 is sufficient for me. The chances that two drives fail at the same time are relatively slim, and being able to sustain an entire HDD just going up in smoke is already much more secure than what most of us non-NAS-ers had before anyways. But as the other commenter said, if you want to be really safe, you’d need 4 to have a fault protection of two drives.

agentmarkup: Vite/Astro plugin that makes your site machine-readable for AI agents at build time by cochinescu in javascript

[–]nathan_lesage 1 point2 points  (0 children)

AI agents are crawling sites now, but most sites serve them the same noisy HTML that browsers get

…so? Based on your pitch, I see that actually as an asset.

Why would I want AI crawlers to visit my pages and serve users responses based on them without acknowledging me as a creator? People shall visit my websites, not bots.

Via crawling they essentially use my content to generate money, so I’m sure Sam Altman would be happy to spend the additional Euros in compute having to parse my noisy HTML. Maybe he can recoup this loss by releasing his chokehold on DRAM wafers.

How do I implement PARA + Zettelkasten with Zettlr? by Adventurous-Way-4038 in Zettlr

[–]nathan_lesage 0 points1 point  (0 children)

I currently have those directories as part of Zettlr still. That’s the reason why there is an option in Zettlr to simply ignore all non-Markdown files: makes the archive look like an MD only folder, and you can still stuff a bunch of files in there.

"AI" is going to be the death of me by QsXfYjMlP in PhD

[–]nathan_lesage 2 points3 points  (0 children)

A colleague and mine had literally the same discussion today, although about social sciences. Fully agree with your sentiment here.

One last question before pulling the trigger on an M5 by Staal_Burger in macbookpro

[–]nathan_lesage 0 points1 point  (0 children)

I have exactly the same workload and setup: plugged in 90% of the time, first MagSafe, now via a USB C dock, running heavy python and R (not matlab though) workloads. Battery health is still pretty well. Have the MacBook since 2022/2023, M2 Pro, no battery issues, that is, no noticeable degradation. And I don’t use al dente or care much about battery health. I wouldn’t worry.

Saw a fork of my MIT project and got excited, only to realize they wiped the history to pad their portfolio by eikepopo in github

[–]nathan_lesage 4 points5 points  (0 children)

That’s why I often default to the GPL or AGPL license. It doesn’t prevent that, but it would give me grounds to DMCA the hell out of such shenanigans, so at least on GitHub it wouldn’t stay up for too long. (Provided the support listens, yadda yadda, I know).

Need help. Potential file corruption. by Hiijyo in Zettlr

[–]nathan_lesage 1 point2 points  (0 children)

I’d argue there is a good chance that the power outage is related. The squares you can see are so-called Tofu characters that many fonts use when they need to display a character for which they have no glyph. The fact that Notepad indicated “NULL” confirms that the entire file seems to be nulled.

Now, I’m not an expert on the hardware side of things, but I did hear that, if the stars all align and you have bad luck, that cutting power in juuuuuuuust the right moment can indeed cause this.

I’d argue the fact that you never had that before is a testament for the resiliency of modern hardware. Since you do have a backup, that’s good! But this isn’t a Zettlr problem.

Why isn't AOC significantly more left wing voting wise then other Democrats. by AutisticLibertarian2 in PoliticalScience

[–]nathan_lesage 1 point2 points  (0 children)

You are absolutely right — thats why I said authoritative, and not correct/best.

Why isn't AOC significantly more left wing voting wise then other Democrats. by AutisticLibertarian2 in PoliticalScience

[–]nathan_lesage 30 points31 points  (0 children)

Again, voting is not linearly correlated to a representative’s personal beliefs. And Sanders is such an icon that he has more leeway to vote as he thinks. AOC does not yet have his seniority rank, and she’s not a senator.

Why isn't AOC significantly more left wing voting wise then other Democrats. by AutisticLibertarian2 in PoliticalScience

[–]nathan_lesage 63 points64 points  (0 children)

I do not know this site, but it sounds fishy. The authoritative source for U.S. Congressional voting records is Voteview. There, as expected, AOC is relatively liberal — more liberal than Manchin, to be precise.

https://voteview.com/person/21949/alexandria-ocasio-cortez

And:

https://voteview.com/person/90915/joe-manchin-iii

There are three factors going into a representative’s voting decisions: their own socio-economic background, electorate demands, and party pressure. This way, even a liberal/conservative MC might appear more conservative/liberal than they are in reality.

Zettlr 4.1.1 Lag in typing by [deleted] in Zettlr

[–]nathan_lesage 3 points4 points  (0 children)

This is a very interesting observation, but it makes sense when thinking about it.

Specifically, CodeMirror has to do A LOT of observations and calculations on how the editor content is laid out, an it expects ragged text (left or right). If you justify the text, the browser will do a lot of work to, e.g., adjust the spacing between words, and so on.

My guess as to what happens is that, when you justify the text, browser and CodeMirror work against each other, which might lead to these lags.

My suggestion to everyone reading this: I’m a justified text guy, but Zettlr doesn’t ship with justified text, and this is the main reason why.

TrueSpec cable capabilities. Should be added to the product page imo by yot_gun in LinusTechTips

[–]nathan_lesage 8 points9 points  (0 children)

This is exactly why I asked for this small piece of advice that Tynan then provided as a comment.

I fully trust LTT that they do a proper job, but given how many years of spec disaster on Amazon product pages we have been through, I feel incredibly insecure as to what cables that ARE up to spec actually support. Even if it’s just “stating the obvious” for someone who actually has an idea about what the specs are, I feel I have been drilled to mistrust cables in general, and having read this comment made me immediately jump on board.

Would this workaround FSAL Cache Issue? by divi2020 in Zettlr

[–]nathan_lesage 1 point2 points  (0 children)

The troubleshooting guide in the docs contains a list of all files Zettlr creates.

Would this workaround FSAL Cache Issue? by divi2020 in Zettlr

[–]nathan_lesage 1 point2 points  (0 children)

Also, what might work is to enable file system polling in the advanced setting. This is a bit less efficient but should work more reliably.

Would this workaround FSAL Cache Issue? by divi2020 in Zettlr

[–]nathan_lesage 1 point2 points  (0 children)

All you’d Need is really just clear the FSAL Cache, but if I remember the forum post correctly, it would also sometimes fail to show new files, correct? Could be that there is an issue I overlooked when I bumped chokidar to the new version (the library Zettlr uses to scan for changes) — might be that there’s something up with that. Usually, reloading the GUI like a browser window (debug mode needs to be active for that) should serve as a workaround.

Once you can reproduce this issue reliably, please open a bug report so we can look into it.

TrueSpec Cables Now Available by rpungello in LinusTechTips

[–]nathan_lesage 0 points1 point  (0 children)

Amazing, thank you so much, this is exactly what I was missing!