Monday, September 16, 2024

Re: Bug When Creating a Next.js Project on OpenBSD 7.5 and -current

Dear Volker,

Thank you for your update and for fixing the issue with Oniguruma.

Unfortunately, I don't have the necessary expertise to implement the Node.js os.cpus().
Nevertheless, I truly appreciate all the work you've put into this and your helpful suggestions.

Best regards,

-----Message d'origine-----
De : owner-ports@openbsd.org <owner-ports@openbsd.org> De la part de Volker Schlecht
Envoyé : lundi 16 septembre 2024 20:16
À : wesley@bsdtaste.org
Cc : ports@openbsd.org
Objet : Re: Bug When Creating a Next.js Project on OpenBSD 7.5 and -current

Hi,

also on-list:

I just committed a fix regarding the issue with Oniguruma.

The problem with NextJS is that nobody implemented the NodeJS os.cpus() API for deno on OpenBSD ... yet. I plan to, but I haven't gotten around to it.
I'd be happy to test patches, too :-)

For now, my suggestion would be to use lang/node and npx to bootstrap your NextJS app, and if you're dead set on running it on deno, to replace the calls to os.cpu() with something else.
Chance is that they just use os.cpus().length to calculate the number of worker threads to start, so it should be possible to replace those cases with a constant.

cheers,
Volker

On 2024-09-16 17:07, wesley@bsdtaste.org wrote:
>Hi,
>
>I'm trying to create a Next.js project using Deno.
>
>I tried on both OpenBSD 7.5 and -current.
>
>Below is a report of what I did for both versions:
>
># Using OpenBSD 7.5
>
>```
>test# deno run -A npm:create-next-app@latest my-next-app ✔ Would you
>like to use TypeScript? … No / Yes ✔ Would you like to use ESLint? … No
>/ Yes ✔ Would you like to use Tailwind CSS? … No / Yes ✔ Would you like
>to use `src/` directory? … No / Yes ✔ Would you like to use App Router?
>(recommended) … No / Yes ✔ Would you like to customize the default
>import alias (@/*)? … No / Yes Creating a new Next.js app in
>/root/test/my-next-app.
>
>Using npm.
>
>Initializing project with template: app
>
>
>Installing dependencies:
>- react
>- react-dom
>- next
>
>
>============================================================
>Deno has panicked. This is a bug in Deno. Please report this at
>https://github.com/denoland/deno/issues/new.
>If you can reliably reproduce this panic, include the reproduction
>steps and re-run with the RUST_BACKTRACE=1 env var set and include the
>backtrace in your report.
>
>Platform: openbsd x86_64
>Version: 1.36.4
>Args: ["deno", "run", "-A", "npm:create-next-app@latest",
>"my-next-app"]
>
>thread 'main' panicked at runtime/ops/os/mod.rs:67:40:
>called `Result::unwrap()` on an `Err` value: Error { kind:
>Uncategorized, message: "no current exe available (short)" }
>note: run with `RUST_BACKTRACE=1` environment variable to display a
>backtrace ``` with RUST_BACKTRACE=full:
>
>```
>test# RUST_BACKTRACE=full deno run -A npm:create-next-app@latest
>my-next-app ✔ Would you like to use TypeScript? … No / Yes ✔ Would you
>like to use ESLint? … No / Yes ✔ Would you like to use Tailwind CSS? …
>No / Yes ✔ Would you like to use `src/` directory? … No / Yes ✔ Would
>you like to use App Router? (recommended) … No / Yes ✔ Would you like
>to customize the default import alias (@/*)? … No / Yes Creating a new
>Next.js app in /root/test/my-next-app.
>
>Using npm.
>
>Initializing project with template: app
>
>
>Installing dependencies:
>- react
>- react-dom
>- next
>
>
>============================================================
>Deno has panicked. This is a bug in Deno. Please report this at
>https://github.com/denoland/deno/issues/new.
>If you can reliably reproduce this panic, include the reproduction
>steps and re-run with the RUST_BACKTRACE=1 env var set and include the
>backtrace in your report.
>
>Platform: openbsd x86_64
>Version: 1.36.4
>Args: ["deno", "run", "-A", "npm:create-next-app@latest",
>"my-next-app"]
>
>thread 'main' panicked at runtime/ops/os/mod.rs:67:40:
>called `Result::unwrap()` on an `Err` value: Error { kind:
>Uncategorized, message: "no current exe available (short)" } stack backtrace:
> 0: 0xc112804f4cd - <unknown>
> 1: 0xc112806cf11 - <unknown>
> 2: 0xc1128010d24 - <unknown>
> 3: 0xc112804f2a3 - <unknown>
> 4: 0xc1128011ae7 - <unknown>
> 5: 0xc1128011750 - <unknown>
> 6: 0xc1124f2aae8 - <unknown>
> 7: 0xc112801218c - <unknown>
> 8: 0xc112804fb97 - <unknown>
> 9: 0xc112804f70d - <unknown>
> 10: 0xc1128011d27 - <unknown>
> 11: 0xc11280732aa - <unknown>
> 12: 0xc1128073f5a - <unknown>
> 13: 0xc1125a8f72e - <unknown>
> 14: 0xc1125a8ef9b - <unknown>
>```
>
># Now with OpenBSD Snapshots (actually: 7.6-beta, deno 1.45.5)
>
>```
>test# uname -a
>OpenBSD test.local 7.6 GENERIC#306 amd64 test# deno --version deno
>1.45.5 (release, x86_64-unknown-openbsd)
>v8 12.7.224.13
>typescript 5.5.2
>test# deno run -A npm:create-next-app@latest my-next-app
>ld.so: deno: can't load library 'libonig.so.8.0'
>Killed
>test# pkg_add oniguruma
>quirks-7.49 signed on 2024-09-13T15:15:19Z
>oniguruma-6.9.9: ok
>test# ls /usr/local/lib/libonig.so.8.0
>/usr/local/lib/libonig.so.8.0
>test# deno run -A npm:create-next-app@latest my-next-app
>error: Uncaught TypeError: Failed to get cpu info
> at Object.cpus (node:os:63:10)
> at Object.423 (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:33:19721)
> at __nccwpck_require__ (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:73:59379)
> at Object.8695 (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:33:4682)
> at __nccwpck_require__ (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:73:59379)
> at Module.8776 (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:73:35050)
> at __nccwpck_require__ (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:73:59379)
> at file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:73:60243
> at Object.<anonymous> (file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.11/dist/index.js:73:60287)
> at Object.<anonymous>
>(file:///root/.cache/deno/npm/registry.npmjs.org/create-next-app/14.2.1
>1/dist/index.js:74:4)
>```
>
>If anyone can help me...
>
>Thank you very much!
>
>/Wesley
>

No comments:

Post a Comment