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.
The command line
Section titled “The command line”command not found: nuib
Section titled “command not found: nuib”- Cause: The shell does not find
nuib(this is the zsh message; bash printsnuib: command not found).nuibis not on yourPATH: thenitro-ui-brownfield-clipackage puts it in the React project’snode_modules/.bin. - Fix: Run it inside the React project as
bun run nuib <command>. See Runnuibthrough Bun.
error: Script not found "nuib"
Section titled “error: Script not found "nuib"”- 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.
env: bun: No such file or directory
Section titled “env: bun: No such file or directory”- Cause: You ran
./node_modules/.bin/nuibdirectly. The command starts with#!/usr/bin/env bun, and Bun is not on yourPATH. - Fix: Install Bun and put it on your
PATH, or runbun 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.jsonhas nobrownfieldkey, sonuibdoes not know the artifact’s name or version. The command exits with1. - 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 checkruns the project’s owntsc, and the project has none. Thetypescheck fails, so the exit code includes4. - Fix: Add
typescriptto the project’sdevDependenciesand install.
The patch step
Section titled “The patch step”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.
Packaging and publishing
Section titled “Packaging and publishing”No packaged manifest at …: run nuib package first.
Section titled “No packaged manifest at …: run nuib package first.”- Cause:
nuib publishfound no manifest, so nothing was packaged for this version. - Fix: Run
nuib package, thennuib publishagain.
… 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 packageagain.
… 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
nameandversion, and a published version is not changed by default. - Fix: Raise
brownfield.versioninpackage.json. Use--forceonly 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 packagewithout--variant dev(the default isrelease), then publish.
nuib package --variant release refuses while a link is recorded in .nuib/links.json: … or nuib publish refuses while a link is recorded …
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 anuib dev ios|androidthat 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>(asbun run nuib unlink <app>). The nextnuib devalso clears a link a killednuib devleft.
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 --jsonand read which checks failed. See Check the contract.
In the native app
Section titled “In the native app”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.
fingerprintMismatch
Section titled “fingerprintMismatch”- 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
registerSurfacefrom 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-v8aonly, 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" }todefaultConfigin the native app’s Gradle build.nuib packageprints 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
arm64slices only. A build for a generic simulator destination, for example-destination 'generic/platform=iOS Simulator'in CI, also buildsx86_64, and that architecture finds no module. - Fix: Add
ARCHS=arm64to thexcodebuildcommand, or build for one booted Apple silicon simulator.
iOS: no [brownfield] log lines at all
Section titled “iOS: no [brownfield] log lines at all”- 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 iosornuib 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 devin the React project, then press Retry in the notice or launch the app again. To leave development, runbun run nuib unlink <app>and build the app again.