ICU symbol not found with node and bun

Hi folks, I am trying to build a react native project and I am using bun as the package manager, but I am getting the following error message:

  📦 Installing [1662/1951] dyld[46253]: Symbol not found: __ZNK6icu_746number23NumberFormatterSettingsINS0_24LocalizedNumberFormatterEE10toSkeletonER10UErrorCode
  Referenced from: <2012A65E-5EB9-311D-80C8-99FD31D3890D> /nix/store/9vkabbbbyfn8hv5l1r8fm59d27imq460-nodejs-22.11.0/bin/node
  Expected in:     <59FD1226-789A-3063-B6B6-2E92BEEA57E8> /nix/store/3v1icdy3q210szf1ccwvxngskixn2p0d-ICU-74221/lib/libicui18n.74.2.dylib

error: postinstall script from "esbuild" terminated by SIGABRT (Abort)
[1]    46249 abort      bun install

Setup:

  • MacOS Sequoia Version 15.2 (24C101)
  • I have the following packages installed:
    • bun
    • nodejs_22

Here’s a simple package.json that can help reproduce the error:

{
  "name": "bun-demo",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "esbuild": "0.24.2"
  },
  "trustedDependencies": [
    "esbuild"
  ]
}

bun install should give you the error.

I tried this on a CentOS 9 box and things work fine so I guess it is a MacOS specific issue.

I have tried various things like trying to include icu76 by following this and this, but it is still using a different icu.

This also seems to be related to bun: fix darwin build and runtime issues by sandydoo · Pull Request #358195 · NixOS/nixpkgs · GitHub. It is forcing nix to use darwin.ICU which is at version 74221.

I am very new to all this and I tried a few different approaches and had no luck. Any tips would be appreciated.

This should be fixed on staging-next. Darwin’s ICU is being made the default.

The problem is upstream icu includes the version number in symbol names while Darwin’s ICU does not. Once Node.js is rebuilt with the unversioned symbols, this error should go away.

1 Like

Hi @reckenrode, thanks for the reply!

I apologize for the delay in responding, I missed the email notification.

I am using packages from nixos-unstable, and my understanding is that they should now include the fix you mentioned.

I’m still encountering this issue even with the updated packages. Are there any debugging steps or checks you might recommend I try?

The staging-next cycle with the fix is still in progress. You can see an overview of the current eval here. There are still ~18k packages queued to build, but the cycle appears to be almost done. Once staging-next is merged into master, it typically takes a few days for the nixos-unstable channel to update. You can track the status of the darwin.ICU PR at https://nixpkgs-tracker.ocfox.me/?pr=360922.

Using this flake, I was able to execute bun install successfully using staging-next as my branch.

$ bun install
bun install v1.1.43 (76800b04)

+ esbuild@0.24.2

2 packages installed [2.56s]
Removed: 2
2 Likes

Thanks so much, @reckenrode! Those links are super useful to me, especially since I’m still super new to all this. Really appreciate your help! Will keep an eye out on the staging-next to master process!

1 Like