---
title: "X18N3001: Source file could not be scanned"
description: "Source file could not be scanned. Fix the syntax error, or exclude the file with `usage.exclude`."
canonical_url: "https://x18n.dev/errors/x18n3001"
---
# X18N3001: Source file could not be scanned

> Source file could not be scanned. Fix the syntax error, or exclude the file with \`usage.exclude\`.

<!-- Generated by docs/scripts/generate.ts from the source code. Do not edit. -->

## Message

```
[X18N3001] Source file could not be scanned <detail>
├▶ fix: Fix the syntax error, or exclude the file with `usage.exclude`.
╰▶ see: https://x18n.dev/errors/x18n3001
```

The CLI prints the code and why the error happened, with details such as a file name or a field. The fix and a link to this page follow. With `--json`, the same parts are in `errors` of the [envelope](https://x18n.dev/references/json-contracts).

## What to do

A scanner failed to parse a source file, so x18n did not find the usages in it.

1. Fix the syntax error in the file.
2. If the file is generated or is not source code, exclude it with `usage.exclude`.

`x18n check` reports this as an `invalid-resource` warning on the file.

## Exit code

The CLI exits with code `1`.

## Source

- [`packages/core/src/project/project.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/core/src/project/project.ts)


## Sitemap

See the full [sitemap](https://x18n.dev/sitemap.md) for all pages.
