CesiumGS / CesiumGS/cesium

Uncaught DeveloperError: Expected Year to be greater than or equal to 1 - when zooming out timeline

Open
#13,769 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs triage type - bug
Dominant language
JavaScript
Stars
15.8k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### What happened?

If you use the mouse wheel to zoom out a long way on the timeline (past when other centuries are visible), eventually the following error is produced:

Uncaught DeveloperError: Expected Year to be greater than or equal to 1, actual value was -160
Error
at new DeveloperError (https://sandcastle.cesium.com/js/engine/index.js:12353:11)
at Check.typeOf.number.greaterThanOrEquals (https://sandcastle.cesium.com/js/engine/index.js:12440:11)
at validateRange (https://sandcastle.cesium.com/js/engine/index.js:16789:33)
at GregorianDate (https://sandcastle.cesium.com/js/engine/index.js:16771:3)
at _JulianDate.toGregorianDate (https://sandcastle.cesium.com/js/engine/index.js:17377:14)
at Timeline._makeTics (https://sandcastle.cesium.com/js/widgets/index.js:11200:37)
at Timeline.zoomTo (https://sandcastle.cesium.com/js/widgets/index.js:11104:8)
at Timeline.zoomFrom (https://sandcastle.cesium.com/js/widgets/index.js:11125:8)
at HTMLDivElement. (https://sandcastle.cesium.com/js/widgets/index.js:11509:14) (on line 12440 of https://sandcastle.cesium.com/js/engine/index.js)

And it doesn't appear to be recoverable.

### Reproduction steps

1. Load any Sandcastle
2. Put cursor over timeline
3. Use mouse wheel to zoom out - keep going until you get the error (which is around when you can see other centuries)

### Sandcastle example

Any

### Environment

Browser: Edge
CesiumJS Version: 1.145.0
Operating System: Windows

### AI acknowledgment

- [ ] I used AI to generate this issue report.
- [ ] (If the above is checked) I have reviewed the AI-generated content before submitting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by zooming out repeatedly over the timeline in any Sandcastle. Start at Timeline.zoomFrom and Timeline.zoomTo, then inspect Timeline._makeTics and its call to JulianDate.toGregorianDate, which reaches GregorianDate validation. Done means zooming out past other centuries no longer throws the reported negative-year error and the timeline remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.