# Troubleshooting

> Fix a blank or unstyled Gantt, tasks that land on other dates than your data says, ignored links and loops, calendar mismatches, watermarks and slow large projects.

The Gantt falls back to defaults instead of throwing, and logs a warning that starts with `[Birch UI Gantt]`. Check the browser console first.

| Symptom | Jump to |
| --- | --- |
| Nothing renders, or only the header | [The Gantt is blank](#the-gantt-is-blank) |
| Bars, grid and headers are unstyled | [The Gantt has no styles](#the-gantt-has-no-styles) |
| A task is missing or placed at the top level | [A task is missing or in the wrong place in the tree](#a-task-is-missing-or-in-the-wrong-place-in-the-tree) |
| A task starts later than its `start` | [A task does not start on its start date](#a-task-does-not-start-on-its-start-date) |
| `updateTask(id, { start })` has no visible effect | [A task does not start on its start date](#a-task-does-not-start-on-its-start-date) |
| A one-day task runs into the next morning | [Durations do not match whole days](#durations-do-not-match-whole-days) |
| A link is ignored, or `cycleDetected` fires | [A dependency is ignored](#a-dependency-is-ignored) |
| A task has `hasConflict: true` | [A task shows a constraint conflict](#a-task-shows-a-constraint-conflict) |
| `the project is too long for this view preset…` | [The timeline is shortened](#the-timeline-is-shortened) |
| "Birch UI Gantt · unlicensed copy" in the corner | [A watermark appears](#a-watermark-appears) |
| `Refused to apply inline style` in the console | [A Content Security Policy blocks the styles](#a-content-security-policy-blocks-the-styles) |
| Two copies of a package, or a large bundle | [Duplicate packages and bundle size](#duplicate-packages-and-bundle-size) |
| Editing a large project is slow | [Large projects are slow](#large-projects-are-slow) |
| Problems only in React, Vue, Svelte or Angular | [Framework adapters](#framework-adapters) |

## The Gantt is blank

**Cause.** Without a `height` option, the Gantt root is `height: 100%` of its container. A container with no height collapses.

**Fix.** Pass `height`, as pixels or any CSS length, or give the container a height:

```ts
createGantt(document.querySelector<HTMLElement>('#office-move')!, {
  tasks,
  dependencies,
  height: 560,
});
```

## The Gantt has no styles

**Cause.** With `injectStyles: false`, the Gantt does not add its stylesheet.

**Fix.** Import `@birchui/gantt/styles.css`, or insert the exported `ganttStyles` string into a shadow root yourself. See [Importing the CSS file](https://docs.birchui.com/getting-started/installation.md#importing-the-css-file).

## A Content Security Policy blocks the styles

**Cause.** Injected styles are a `<style>` element, which a `style-src` policy without `'unsafe-inline'` blocks. The injected element has no nonce option.

**Fix.** Set `injectStyles: false` and import `@birchui/gantt/styles.css` through your bundler.

## A task is missing or in the wrong place in the tree

**Cause.** The engine validates the task list and logs what it changed:

```text
[Birch UI Gantt] every task needs a non-empty string id; skipped one task
[Birch UI Gantt] task id "fit-out" is used more than once; kept the first
[Birch UI Gantt] task "cabling" has an unknown parentId "floor-3"; placed it at the top level
[Birch UI Gantt] task "cabling" is part of a parentId loop; placed it at the top level
```

**Fix.** Give every task a unique string `id`, including numeric keys from your database (`String(row.id)`), and make each `parentId` point at an existing task. See [The tree](https://docs.birchui.com/gantt/tasks.md#the-tree).

## A task does not start on its start date

**Cause.** Dates are computed, not copied. A task with predecessors starts as soon as its links allow, so its own `start` is ignored. `updateTask(id, { start })` from code adds no constraint, so on a linked task the links win. Dragging a bar does add a `snet` constraint, which is why a dragged task stays put.

**Fix.** To pin a linked task to a date, set a constraint with the start:

```ts
gantt.updateTask('cabling', { start: '2027-02-08T08:00', constraint: { type: 'snet', date: '2027-02-08T08:00' } });
```

Remove it again with `{ constraint: null }`. A task with no predecessors keeps its `start` unless `unlinkedTaskStart` is `'projectStart'`. See [How dates are computed](https://docs.birchui.com/gantt/scheduling.md#how-dates-are-computed) and [Dragging sets a constraint](https://docs.birchui.com/gantt/scheduling.md#dragging-sets-a-constraint).

## Durations do not match whole days

**Cause.** Durations are working time. `hoursPerDay` (default 8) converts days to hours, so with a 7.5-hour calendar a one-day task ends 30 minutes into the next working day. A task on a calendar the engine cannot find logs `task "…" uses unknown calendar "…"; using the project calendar`, and an unknown `calendarId` logs `calendarId "…" does not match a calendar; using the standard calendar`.

**Fix.** Set `hoursPerDay` and `daysPerWeek` to your calendar's working day and week, and check calendar IDs. Set `timeZone` explicitly for projects shared across offices. See [Match hoursPerDay to your calendar](https://docs.birchui.com/gantt/calendars.md#match-hoursperday-to-your-calendar).

## A dependency is ignored

**Cause.** A link to a task that does not exist logs `dependency "…" refers to a task that does not exist; skipped`. A duplicate link ID logs `dependency id "…" is used more than once; kept the first`. A link added from code that breaks a rule, such as one that would create a loop, logs `dependency from "…" to "…" rejected: …`. Loops in loaded data are not logged: the engine ignores the links that close each loop and emits `cycleDetected`.

**Fix.** Listen for `cycleDetected` and fix the data it reports:

```ts
gantt.on('cycleDetected', ({ cycles }) => {
  for (const { taskIds, dependencyIds } of cycles) {
    console.warn(`Loop through ${taskIds.join(', ')}; ignored links ${dependencyIds.join(', ')}`);
  }
});
```

See [Loops in loaded data](https://docs.birchui.com/gantt/dependencies.md#loops-in-loaded-data) and [Rules and validation](https://docs.birchui.com/gantt/dependencies.md#rules-and-validation).

## A task shows a constraint conflict

**Cause.** A `snlt`, `fnlt`, `mso` or `mfo` constraint that its links cannot meet wins over the links. The task gets `hasConflict: true` and the class `lq-gantt-bar--conflict`, and its predecessors get negative slack. A constraint without a valid date logs `task "…" has a … constraint without a valid date; ignored`.

**Fix.** Move the constraint date, shorten the predecessors, or remove the constraint. Read `conflicts` from the `tasksScheduled` event to show the problem to users. See [When links and constraints disagree](https://docs.birchui.com/gantt/scheduling.md#when-links-and-constraints-disagree).

## The timeline is shortened

**Cause.** A long project at a fine preset produces too many ticks. The Gantt logs `the project is too long for this view preset; the timeline was shortened`. An unknown preset name logs `unknown view preset "…"; using …`.

**Fix.** Use a coarser `viewPreset`, such as `'weekAndMonth'` or `'monthAndQuarter'`, for long programmes.

## A watermark appears

**Cause.** The Gantt checks its key for `gantt` offline. On a non-local host with no valid key, a watermark appears and one warning is logged, for example:

```text
[Birch UI] No license key is set for Birch UI Gantt. All features keep working; a watermark is shown on non-local hosts until a valid license key is set. Purchase a license at https://birchui.com/pricing
```

**Fix.** Call `setLicenseKey` from `@birchui/license` in the browser bundle, or pass `licenseKey` to `createGantt`. With server rendering, expose the key through a public variable such as `NEXT_PUBLIC_BIRCHUI_LICENSE_KEY`; see [The license key is not applied with server rendering](https://docs.birchui.com/frameworks/troubleshooting.md#the-license-key-is-not-applied-with-server-rendering) and [What happens without a valid key](https://docs.birchui.com/getting-started/licensing.md#what-happens-without-a-valid-key). The headless `createGanttProject()` engine has no widget and shows no watermark.

## Duplicate packages and bundle size

**Cause.** Two installed versions of `@birchui/core` or `@birchui/license` split their state, so a key set in one copy is not seen by the other.

**Fix.** Run `npm ls @birchui/core @birchui/license`, align all `@birchui/*` packages on one version and run `npm dedupe`, or add `overrides` in `package.json`. The package is side-effect free apart from its CSS, so a server bundle that imports only `createGanttProject` leaves the widget code out. See [Bundle size](https://docs.birchui.com/gantt/performance.md#bundle-size).

## Large projects are slow

**Cause.** Each API call is a scheduling run and an undo step. Calling `addTask` in a loop, passing a new `tasks` array on every framework render, or heavy column renderers and tooltips slow large projects down.

**Fix.** Load everything at once with `tasks`, `setTasks` or `fromJSON`, keep arrays stable, keep renderers cheap, and use `autoSchedule: false` while users rearrange many tasks. See [Guidelines for large projects](https://docs.birchui.com/gantt/performance.md#guidelines-for-large-projects).

## Framework adapters

Wrap the Gantt with `createReactComponent(ganttDefinition)` or the equivalent factory in another adapter. For Strict Mode, reactive proxies and the Angular zone, see:

- [The widget is created twice in development](https://docs.birchui.com/frameworks/troubleshooting.md#the-widget-is-created-twice-in-development)
- [Changes to rows do not reach the widget](https://docs.birchui.com/frameworks/troubleshooting.md#changes-to-rows-do-not-reach-the-widget), which applies to `tasks` and `dependencies`
- [Vue makes large data slow](https://docs.birchui.com/frameworks/troubleshooting.md#vue-makes-large-data-slow) and [Svelte state makes large data slow](https://docs.birchui.com/frameworks/troubleshooting.md#svelte-state-makes-large-data-slow)
- [Angular views do not update after a widget event](https://docs.birchui.com/frameworks/troubleshooting.md#angular-views-do-not-update-after-a-widget-event)

## Related

- [API reference: @birchui/gantt](https://docs.birchui.com/api/gantt.md)
- [Limitations](https://docs.birchui.com/gantt/limitations.md)
