> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ploterr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Find the cause of a problem with the install, the start-up, the view or an edit.

Find the heading that agrees with what you see. Each one gives the cause and the correction.

## The install stops with an authentication error

`@opengeometry/floorkit` is a public package and needs no token. This error has one usual cause: an `.npmrc` file sends an old token to the npm registry. The file can be in your app, in your home folder or in your CI.

Renew the token or remove it. Then install again.

## The geometry kernel does not start

Look at the network panel of your browser and find the request for the `.wasm` file.

* **404 or an HTML page:** the address is wrong. Pass the correct address to `setupOpenGeometry`. With Vite, import the file with `?url`. See [Installation](/floorkit/installation).
* **The request is correct but geometry fails:** you created geometry before the setup finished. Await `setupOpenGeometry()` first.

## The console says "Multiple instances of Three.js being imported"

Your app has two copies of Three.js. The text package that Floorkit uses asks for a newer Three.js than your app has, so npm installs a second copy for it. The app runs, but it is larger, and text is made by a different copy than your scene.

Tell npm to use your copy everywhere. Add this to the `package.json` of your app:

```json theme={null}
{
  "overrides": {
    "three": "$three"
  }
}
```

Then delete `node_modules` and `package-lock.json` and install again. `npm ls three` must show one version.

## An error says "Scene not assigned"

You created a datum, a dimension or a room label before Floorkit had a scene for its text. Call `await setGlyphScene(scene, camera)` after the kernel setup and before you create these objects. See [Use your Three.js scene](/floorkit/guides/use-your-threejs-scene#text-labels).

## The canvas is blank

Check these things in sequence:

1. The container of the canvas has a width and a height.
2. Your render loop calls `renderer.render(scene, camera)`.
3. `session.root` is in the scene.
4. The camera looks at the building. A building near `[0, 0, 0]` is not visible from inside a wall.
5. The scene has a light.

## A view stops and shows "This site needs a floorkit license"

The page is on a deployed site and has no valid license key. Floorkit is free on `localhost`. Each other hostname needs a key, and this includes an address on your local network such as `192.168.1.20`.

Read `getLicenseState()` and see [Licensing](/floorkit/licensing).

## A view goes blank and shows no message

The "made with floorkit" badge is hidden or covered by your interface. Keep the bottom-right corner of the view free. The view draws again when the badge is visible.

## A door or a window does not cut its wall

In a building model, a door must be an entry in the `openings` of its wall. A door in `unhostedOpenings` is a free door and cuts nothing.

With element classes, call `wall.attachDoor(door, ...)` and then `wall.commitOpeningCuts()`. A door that you only add to the scene cuts nothing.

## `apply` throws an error

| Error | Cause | Correction |
| - | - | - |
| `BuildingSessionError`, `stale-revision` | A different edit came first | Start the action again from the current state |
| `BmEditError`, `invalid-target` | The command names an id that is not in the model | Check the building, storey and element ids |
| `BmEditError`, `invalid-geometry` | The result is not possible, such as a door that does not fit | Show the message to the user |

After each of these errors, the building is the same as before the edit.

## A change is gone after I reopen the project

The change was not in the model that you saved. Two causes are usual:

* You changed a mesh or an element object directly. Use an [edit command](/floorkit/concepts/editing-and-history).
* You saved an old model. Put `session.snapshot()` into the project before you call `saveProject`.

## A view cannot be drawn

`drawProjectView` and `exportProjectPdf` throw `ProjectDrawingError` with a `code`.

| `code` | Cause |
| - | - |
| `unknown-view` | No saved view has this id |
| `unknown-storey`, `unknown-element` | The view names a storey or an element that is not in the model |
| `empty-view`, `empty-filter` | The view contains nothing to draw |
| `unsupported-view`, `unsupported-element` | Floorkit cannot draw this view or this element yet |
| `inconsistent-build` | The project and the build that you gave are not the same model |

For a section, `unsupported-element` can also mean that the cut line or the far limit of the view touches a wall face or the edge of an opening. Move the line by some centimetres. See [Cut a section](/floorkit/guides/cut-a-section#rules).

## An export fails because of raster views

A sheet shows an isometric view, and its image is missing or old. Call [`prepareProjectRasterViews`](/floorkit/api/views/prepare-project-raster-views) after the last model change, and pass the result to the export in `rasterViews`.

## Memory grows when I close and open views

Something was not disposed. When a view closes, stop the render loop, dispose the editors, remove `session.root`, call `session.dispose()` and dispose your renderer. See [Clean up](/floorkit/guides/use-your-threejs-scene#clean-up).

<Tip>
  When you ask for help, send the package version, your browser, the function that fails and its
  full error message. Our team answers on [Discord](https://discord.gg/zCCbputRYp).
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.