←back to thread

Next.js is infuriating

(blog.meca.sh)
1033 points Bogdanp | 7 comments | | HN request time: 1.681s | source | bottom
Show context
YuukiRey ◴[] No.45101009[source]
I 100% agree. I've ran into the same issues, and I would never use Next.js for anything, and I will encourage every team at work to use something else.

In general Next.js has so many layers of abstraction that 99.9999% of projects don't need. And the ones that do are probably better off building a bespoke solution from lower level parts.

Next.js is easily the worst technology I've ever used.

replies(16): >>45101028 #>>45101139 #>>45101375 #>>45101378 #>>45102069 #>>45102103 #>>45102427 #>>45102810 #>>45102903 #>>45103225 #>>45104004 #>>45104045 #>>45105250 #>>45110734 #>>45112201 #>>45126685 #
berkes ◴[] No.45101139[source]
Many of the abstractions and nextjs tools do things that my OS does better, cleaner and more predictable too.

I suppose the overly complicated ENV/.env loading hierarchy is (partly) needed because Windows doesn't (didn't?) have ENV vars. Same for inotify, port detection, thread management: *nix does it well, consistent ish. But when you want an interface or feature that works on both *nix and windows, in the same way, you'll end up with next.js alike piles of reinvented wheels and abstractions (that in the end are always leaking anyway)

replies(6): >>45101310 #>>45101331 #>>45101509 #>>45101834 #>>45102206 #>>45102363 #
rcxdude ◴[] No.45101310[source]
>Windows doesn't (didn't?) have ENV vars

Nope, windows has had perfectly standard environment variables since the DOS days

replies(1): >>45102080 #
1. colejohnson66 ◴[] No.45102080[source]
What's "missing" is the ability to launch things the "Bash" way: `KEY=value ./myApp`. Where the variable is scoped to the single execution.

Windows' command prompt requires two separate invocations:

    set KEY=value
    ./myApp
PowerShell also:

    $env:KEY='value'
    ./myApp
Or more "verbosely/explicitly":

    [System.Environment]::SetEnvironmentVariable('KEY', 'value')
    ./myApp
Regardless, all those methods aren't "scoped".
replies(1): >>45102279 #
2. amonith ◴[] No.45102279[source]
eh `cmd /C "set KEY=value && ./myApp"` isn't that bad if you really need complete isolation.
replies(1): >>45102948 #
3. RaptorJ ◴[] No.45102948[source]
or directly in powershell, `Start-Process myproc.exe -Environment @{ FOO = 'bar' }`
replies(1): >>45105560 #
4. Sohcahtoa82 ◴[] No.45105560{3}[source]
What an absolutely awful syntax.

How Powershell ever got popular is beyond me.

replies(2): >>45106547 #>>45108309 #
5. encom ◴[] No.45106547{4}[source]
Right? This is your brain on Windows.
replies(1): >>45109214 #
6. amonith ◴[] No.45108309{4}[source]
Because it's objects, not text. It "scales" a lot better in your brain because in general you need to know a lot less than in bash. No more awkward sed and awk scripts, manipulating objects is a breeze. Awkward syntax at places where you have to create an object from scratch is a fair price.
7. ohdeargodno ◴[] No.45109214{5}[source]
yeah | it's | so | much | better | with | bash | tr | cut -d' ' -t5 | jq .entry[].text | sed -i s/who/evenknows/g

Anyone who has ever maintained a semi complex set of bash invocations and pipes knows it's a fragile incantation that breaks anytime you look at it funny, or something in your chain produces unexpected output.

Powershell, while absolutely horrible to read and only slightly less horrible to write (hey look, proper auto completion instead of trying to cut on the 4th, wait no sorry 5th, ah fuck it's the 6th there's an invisible space) at least produces consistent and reproductible results.

No, your python script doesn't count, it makes me do a pip install requests. Oh, sorry, pip can't be used like that, gotta run apt instill python3-pip or my whole system breaks.