Skip to content
Preview: packages are not published yet.

Troubleshooting

Find your symptom, read the cause, apply the fix. Messages are quoted as the tool prints them; … marks a part that changes with your project. For the messages of nuib dev and the viewer, see also the table at the end of Run and develop. For limits that have no fix in the preview, see Known limits.

  • Cause: The shell does not find nuib (this is the zsh message; bash prints nuib: command not found). nuib is not on your PATH: the nitro-ui-brownfield-cli package puts it in the React project’s node_modules/.bin.
  • Fix: Run it inside the React project as bun run nuib <command>. See Run nuib through Bun.
  • Cause: Bun printed this: the current directory is not a project that lists nitro-ui-brownfield-cli, for example the root of a monorepo.
  • Fix: Change to the React project directory and run the command there.
  • Cause: You ran ./node_modules/.bin/nuib directly. The command starts with #!/usr/bin/env bun, and Bun is not on your PATH.
  • Fix: Install Bun and put it on your PATH, or run bun run nuib <command>.

nuib: No "brownfield" key in …/package.json. Add one, for example: …

Section titled “nuib: No "brownfield" key in …/package.json. Add one, for example: …”
  • Cause: The project’s package.json has no brownfield key, so nuib does not know the artifact’s name or version. The command exits with 1.
  • Fix: Add the key. The message prints a complete example; Your first surface explains each field.

tsconfig.json exists but no TypeScript compiler is installed (node_modules/.bin/tsc); add typescript to devDependencies

Section titled “tsconfig.json exists but no TypeScript compiler is installed (node_modules/.bin/tsc); add typescript to devDependencies”
  • Cause: nuib check runs the project’s own tsc, and the project has none. The types check fails, so the exit code includes 4.
  • Fix: Add typescript to the project’s devDependencies and install.

nuib patches … refuses, or verify exits with a number other than 0

Section titled “nuib patches … refuses, or verify exits with a number other than 0”
  • Cause: The patch step checks the Nitro UI version and the state of the patched files before it writes anything. The messages and exit codes are listed on one page.
  • Fix: Find your message in Troubleshooting the patch step. Each one names what to do next. Install shows how to check the result.

No packaged manifest at …: run nuib package first.

Section titled “No packaged manifest at …: run nuib package first.”
  • Cause: nuib publish found no manifest, so nothing was packaged for this version.
  • Fix: Run nuib package, then nuib publish again.

… is not the current sources' package (…): run nuib package again.

Section titled “… is not the current sources' package (…): run nuib package again.”
  • Cause: The packaged manifest belongs to another version or another contract than the current sources.
  • Fix: Run nuib package again.

… is already published in … Bump brownfield.version, or pass --force to replace it.

Section titled “… is already published in … Bump brownfield.version, or pass --force to replace it.”
  • Cause: The registry already holds this name and version, and a published version is not changed by default.
  • Fix: Raise brownfield.version in package.json. Use --force only to replace a version nobody consumed yet.

… is the dev variant; only the release variant is published …

Section titled “… is the dev variant; only the release variant is published …”
  • Cause: The manifest was packaged with --variant dev.
  • Fix: Run nuib package without --variant dev (the default is release), then publish.
Section titled “nuib package --variant release refuses while a link is recorded in .nuib/links.json: … or nuib publish refuses while a link is recorded …”
  • Cause: A native app is linked to this machine’s artifact with nuib link, or a nuib dev ios|android that was killed left its link behind. A linked app builds from the local artifact in every build type, so a release package or a publication is refused.
  • Fix: Run the command the message ends with, nuib unlink <app> (as bun run nuib unlink <app>). The next nuib dev also clears a link a killed nuib dev left.

nuib check exits with a number such as 4, 8, 16 or 32

Section titled “nuib check exits with a number such as 4, 8, 16 or 32”
  • Cause: The exit code is the sum of the failed checks: 4 types, 8 contract, 16 version, 32 size. An exit code of 1 is an error that is not a failed check.
  • Fix: Run nuib check --json and read which checks failed. See Check the contract.

The surface shows a failure instead of React content

Section titled “The surface shows a failure instead of React content”

The state is failed and carries a cause. Log failure.cause and failure.message; the stable strings are bundle-missing, fingerprint-mismatch, evaluation-error, surface-not-registered, render-exception and duplicate-surface-id. Surfaces in your app says what each cause means for your app.

No JavaScript bundle at … (cause bundleMissing)

Section titled “No JavaScript bundle at … (cause bundleMissing)”
  • Cause: The React content was not found at the path in the message, so the runtime did not start.
  • Fix: A retry cannot help. Check that the artifact you added is the one the React team published, and ask for a new build if it is incomplete.
  • Cause: The React content and the native binary were not built together, for example when a bytecode file built for another version of the framework is placed in the app.
  • Fix: A retry cannot help. Ask the React team for a new build of the artifact.

nitro-ui-brownfield was not evaluated by the app bundle (cause surfaceNotRegistered)

Section titled “nitro-ui-brownfield was not evaluated by the app bundle (cause surfaceNotRegistered)”
  • Cause: The JavaScript bundle never imported nitro-ui-brownfield, so no surface is registered.
  • Fix: Import the module that calls registerSurface from the project’s entry file, and check that the name the native code opens matches the registered name.

Surface id … is already open in another host (cause duplicateSurfaceId)

Section titled “Surface id … is already open in another host (cause duplicateSurfaceId)”
  • Cause: One surface descriptor was given to two hosts at once.
  • Fix: Close the first host before opening the second, or create a new descriptor for the second one.

On Android, the app crashes at the first configure on some devices

Section titled “On Android, the app crashes at the first configure on some devices”
  • Cause: The artifact’s native libraries are arm64-v8a only, and another library in the dependency set brings other ABIs, so a device whose primary ABI is another one loads an incomplete set.
  • Fix: Add ndk { abiFilters += "arm64-v8a" } to defaultConfig in the native app’s Gradle build. nuib package prints this notice with the ABIs it built.

iOS: Unable to resolve module dependency: '…' when building for a simulator

Section titled “iOS: Unable to resolve module dependency: '…' when building for a simulator”
  • Cause: The artifact has arm64 slices only. A build for a generic simulator destination, for example -destination 'generic/platform=iOS Simulator' in CI, also builds x86_64, and that architecture finds no module.
  • Fix: Add ARCHS=arm64 to the xcodebuild command, or build for one booted Apple silicon simulator.
  • Cause: The release artifact logs only when logging is turned on, in a Debug build of your app as well as in a Release build.
  • Fix: Launch the app with the argument -BrownfieldLogging YES. See Turn on the library logs.

iOS, dev variant: The dev server … did not answer: …. Showing the app's embedded content.

Section titled “iOS, dev variant: The dev server … did not answer: …. Showing the app's embedded content.”
  • Cause: The app has the dev variant (from nuib dev ios or nuib link --dev), and no dev server answered at the address it recorded. The app shows its embedded content with this notice.
  • Fix: Start the dev server with bun run nuib dev in the React project, then press Retry in the notice or launch the app again. To leave development, run bun run nuib unlink <app> and build the app again.