> For the complete documentation index, see [llms.txt](https://docs.aurelia.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aurelia.io/developer-guides/error-messages/platform/aur1005.md).

# AUR1005

## Error Message

Development builds:

`AUR1005: The PLATFORM did not receive a valid reference to the global function '<name>'.`

Production builds:

`AUR1005:<name>`

Where `<name>` is the missing global function name (for example `queueMicrotask` or `performance.now`).

## Description

This error is thrown by `@aurelia/platform` when a platform API is requested (for example `platform.queueMicrotask(...)`) but the `Platform` instance was created without a usable reference to the underlying global function.

This typically happens when:

* You run Aurelia in an environment that does not provide the expected global (older JS runtimes, unusual embedded runtimes, some test environments).
* The global exists but is not a function, or cannot be bound (for example due to a mocked global).
* You are using `Platform.getOrCreate(globalThis, overrides)` but the required function is missing and you did not provide an override.

## Example Trigger

```ts
import { Platform } from '@aurelia/platform';

// ❌ A mocked global without queueMicrotask
const g = { console } as unknown as typeof globalThis;
const platform = Platform.getOrCreate(g);

// Throws AUR1005 when invoked
platform.queueMicrotask(() => {});
```

## Correct Usage

* Use a runtime that provides the required globals (recommended).
* If you must run in a constrained environment, provide a polyfill or an override when creating the `Platform`.

```ts
import { Platform } from '@aurelia/platform';

const platform = Platform.getOrCreate(globalThis, {
  queueMicrotask: (cb) => Promise.resolve().then(cb),
  performanceNow: () => Date.now(),
});
```

## Troubleshooting

* Inspect the `<name>` parameter in the error to see which global is missing.
* Verify your runtime/test environment provides that API on `globalThis` (or `window` in browsers).
* If you are mocking globals, ensure you return actual functions (and don’t remove/break bindings).
* Add a targeted polyfill/override for the missing API.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aurelia.io/developer-guides/error-messages/platform/aur1005.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
