# extension_unsupported

> A file or import names an extension that is not allowed here.

A file or import names an extension that is not allowed here.

| | |
| --- | --- |
| Kind | Build or validation problem |
| Reported by | Archive and source validation |
| `disko` exit code | 1 (problems) |

A file, or the file an import names, has an extension that is not allowed in
this place. Modules are `.js` (and `.ts` in TypeScript projects only); assets
are lowercase `.png`, `.jpg`, `.jpeg`, `.webp`, `.mp3`, `.ogg` or `.wav`.

## Why it happens

- The extension is not on the list at all (`.json`, `.svg`, `.mjs`, `.jsx`),
  or it is in upper case (`.PNG`).
- `.tsx`, `.mts`, `.cts` and `.d.ts` files are never accepted.
- A JavaScript project (its `entry` ends in `.js`) contains or imports a
  `.ts` file.
- An archive contains a `.ts` file; archives hold only emitted `.js`.

## Wrong

```js title="src/main.js"
import logo from "./logo.svg";
import levels from "./levels.json";
```

## Right

```js title="src/main.js"
import logo from "./logo.png";
import { levels } from "./levels.js";
```

## See also

- [Assets](/games/assets)
- [Project structure & imports](/games/project-structure)
