# Errors Every message Backtick can show you, by who says it, with its fix. Every message Backtick can show you, by who says it, with its fix. Your editor and `npm run typecheck` report the first two groups; the third is thrown by your server, per request, before anything reaches the phone; the last by your app. ## From TypeScript ### Argument of type '…' is not assignable to parameter of type 'Spliceable' The splice holds something that can't cross: a function, a class instance, a `Date`. Splice what it's for instead: a `Date` as a string, a function as a client function, `` cs`(n: number) => …` ``. See [what can cross](/docs/thinking-in-backtick/#splices). ### Argument of type 'void' is not assignable to parameter of type '"a script that makes no value: …"' A script makes no value: a block that returns nothing, or an expression that calls a function returning nothing. A script is one value, made when the bundle loads, so code that only does something is a function, called where it runs: `` cs`() => …` ``, then `$log()`. See [reading a script](/docs/scripts-in-depth/#reading-a-script). ### Cannot find name '…' A script used a name from your server without a `$`, or a name nothing declares. Splice the server's: `$total`, not `total`. See [splices](/docs/thinking-in-backtick/#splices). ### This expression is not callable. Type 'Client<…>' has no call signatures A hook, or another client value, was called in a server component. Hooks belong in a [client component](/docs/thinking-in-backtick/#client-components). ### JSX element type '…' does not have any construct or call signatures A client component was drawn as a tag on your server. Draw it in a script: `` cs`<$Card />` ``. See [client components](/docs/thinking-in-backtick/#client-components). ## From the compiler These are reported in the editor, and thrown when your server loads the file. ### `cs` was not compiled. Is @backtickjs set up for this project? Your server ran a script without the plugin that compiles them. Start it with `node --import @backtickjs/node-plugin`, or on Bun preload `@backtickjs/bun-plugin`. A new project's `npm start` already does. See [How it works](/docs/how-it-works/#1-compiled-with-your-server). ### A `cs` client script is one expression, one class or one block Statements need braces: `` cs`{ a(); b(); }` ``. See the [four shapes](/docs/scripts-in-depth/#four-shapes). ### This `${…}` is in text, not code, so it isn't spliced A `${…}` inside a string or a comment in a script is text to the phone. As an element's child, write it in braces: `{${…}}`. ### A `cs` client script can't hold a template literal A script is a template literal itself, so `` \` `` can't start one inside it. Build the string with `+`: `n + "%"`, not `` `${n}%` ``. In a string or a comment, `` \` `` is a backtick, and fine. ### `\\d` in this regex matches a backslash and `d` A warning. A script is code as written, not a string, so a regex in it is escaped once, as in a `.tsx` file: `/\d+/`, not `/\\d+/`. If you meant a backslash and a letter, ignore it. ### `$`-prefixed names are reserved for unbraced splices in a `cs` client script A script declared a name starting with `$`, as `const $label = …`. Those are splices; name it without the `$`. ### Can't splice `$name` unbraced: a `$`-prefixed host binding splices with braces A server variable whose own name starts with `$`, spliced as `$$name`. Write `${$name}`. ### A tag splices a host value by its name, e.g. `<$Card>`, not with `${…}` A tag was written as `<${Card}>`. Write `<$Card>`. ### `` is drawn by the client, so it belongs in a script A React Native tag was drawn on your server, outside a script. Draw it in one: `` cs`<$View>…` ``. ## From the bundler Thrown by `bundler.build`, for the screen it was building, and by `supports`, where it's called. Each is a `BundlerError`; an error your server component throws passes through as it is. `render` answers each with a bundle that throws it, so the app's `exec` throws an error with the same name and message, and hands it to your `onBundlerError`. ### Can't import `…` from "…": this app doesn't have "…" A screen uses a module the app that asked doesn't provide. For future builds, add it to the app's module map and install it in the app. Builds already in users' hands don't have it: draw them something else with `supports`, as the message says, or catch the `UnsupportedImportError` around `bundler.build` and draw something simpler, as [`@backtickjs/bundler`](https://github.com/backtickjs/backtick/tree/main/packages/bundler#modules) shows. Otherwise `render` answers it with a `406`, which the app can meet with a screen asking to update. See [where a package goes](/docs/react-native-and-packages/#any-package-your-app-ships). ### Can't import `…` from "…": the request lists no modules The request didn't say what the app carries: check it sends its runtime's `modules` in `x-backtick-modules`, as `runtime.fetch` does. To fetch a screen yourself, with `curl` say, send them there: `{"react":"19.2.3","react/jsx-runtime":"19.2.3","react-native":"0.86.3"}`. ### Can't import `…` from "…": this app has an older version The server is typed against a later version than the app was built with. Builds like it are in users' hands, so draw them something else with `supports`. Downgrading the server would break newer builds. ### Can't import `…` from "…": this app has a newer major The app was built with a later major than the server has. If every build in use has it, upgrade the package on the server; otherwise draw older builds something else with `supports`. ### supports("…", "…") asks about the client a build is for `supports` was called outside a build, where there's no client to ask about: in a route handler, say, before `bundler.build`. Call it in a server component, which the bundler runs for the client it's drawing for. ### The modules aren't { specifier: version } What the server passed the bundler as `modules` isn't an object of versions: the app sent something else in `x-backtick-modules`. It sends `JSON.stringify(runtime.modules)`. [`@backtickjs/core`](https://github.com/backtickjs/backtick/tree/main/packages/core#every-build-in-users-hands) has the details. ### Can't splice the host function `…`: it's host code, and only runs on the host A function reached a splice, perhaps through `any`. Write the phone's code as a script, `` cs`(n: number) => …` ``. A server component is drawn with a tag in a braced splice: `{${}}`. ### Can't splice this `…` instance: only plain objects cross into a client script A class instance reached a splice. Cross its data as a plain object, `{ title: todo.title }`, or build it on the phone with a client function. ### Can't splice a symbol A symbol reached a splice, through `any`. Splice its key as a string, and make the symbol in a script: `` cs`Symbol.for($key)` ``. ### Can't splice a value that contains itself A value refers back to itself, such as a tree whose nodes point at their parents. Splice a copy without the back references. ### `…` is a client component, so it can't be a tag on the host A client component, `` cs`(props) => …` ``, was drawn as a tag on your server. Draw it in a script: `` cs`<$Card />` ``. ## From your app ### The module map offers "…", but … isn't in package.json's dependencies The app can't say which version of the package it carries. Install it in the app, `npx expo install `, which lists it, then close the app and open it again. ### The bundle requires "…", which this app doesn't provide The bundle uses a module missing from the module map your app hands to `createRuntime`. Add it, and install it in the app so its native code ships. If your server shouldn't have sent it, check the modules the app sends. See [where a package goes](/docs/react-native-and-packages/#any-package-your-app-ships).