# E4228

Compiler diagnostic name: `invalid_import_all`.

An import uses `*` outside a `.mbtx` script.

Import-all syntax brings a package's definitions into the script's scope and
is intentionally limited to script mode. Regular packages must access an
import through its package alias or import selected names with `using`.

## Erroneous example

```{literalinclude} /sources/error_codes/4228_error/moon.pkg
:language: moonbit
```

## Suggestion

Use a normal package alias in `moon.pkg`, then qualify names from that package.
Alternatively, move genuinely script-like code and its import header to a
`.mbtx` file.

```{literalinclude} /sources/error_codes/4228_fixed/moon.pkg
:language: moonbit
```
