# path_invalid

> A file path breaks the package path grammar.

A file path breaks the package path grammar.

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

A file path, relative to the project or archive root, does not follow the
package path rules. Paths are also the names scripts see for assets, so they
are kept short and portable.

## Why it happens

A package path must:

- be ASCII, at most 128 bytes and at most 8 segments deep;
- have segments of 1–64 bytes that match `^[A-Za-z0-9_][A-Za-z0-9._-]*$`;
- have no segment that ends in `.` or is a Windows reserved name such as
  `con`, `aux`, `nul`, `com1` or `lpt1` (before the first `.`).

Spaces, accents and a leading `.` or `-` are common causes.

## Wrong

```js title="src/main.js"
import kickoff from "./sounds/kick off.ogg";
```

## Right

```js title="src/main.js"
import kickoff from "./sounds/kick-off.ogg";
```

Rename the file on disk to match.

## See also

- [Project structure & imports](/games/project-structure)
- [`specifier_invalid`](/errors/specifier_invalid)
