Diagnostics

Error Levels

The four diagnostic levels, and how to turn one off.
Error

mion could not build the code at all, so there is nothing to ship for it. The build stops there, everywhere, and nothing you write or set turns it off.

RuntimeError

The build is not stopped during dev mode but code will generate an error at runtime. Production build will fail so you don't ship runtime errors.

Warning

Worth knowing, nothing is broken, but the result may surprise you: a clone that shares a value with the original, a tag that does nothing. It never stops anything.

Info

mion works as documented: a method a validator skips, a validator on a type you wrote as any. Hidden unless you set levels to all.

Every diagnostic has a name like validate-symbol-root: its area, then what went wrong. Error and RuntimeError both print the word error, so check the name to see which one you got. Every name is listed in All Diagnostics.

Where Each Level Shows

The dev server shows only what breaks your running code.

WhereErrorRuntimeErrorWarningInfo
Editor, through the lint rulesmion/errormion/runtime-errormion/warningmion/info, off by default
Dev server terminalprinted onceprinted onceone line counting themnot printed
Browser overlayshown when its file loadsnot shownnot shownnot shown
Build and CIprinted, the build stopsprinted, the build stopsprintedprinted with levels: 'all'
The dev server never stops on an error. A function with a RuntimeError throws when your code calls it.

Disabling Errors

Two comments turn an error off:

  • @mion-expect-error hides it.
  • @mion-downgrade-error shows it as a warning, so the build does not fail.

Use // above a line to cover that line. Use /* */ at the top of the file, before any code, to cover the whole file. Several names fit on one comment.

disabling-errors.ts
/* @mion-downgrade-error validate-symbol-root */
import {createValidateFn} from '@mionjs/run-types';

// both raise validate-symbol-root; the file comment above makes them warnings
export const validateSymbol = createValidateFn<symbol>();
export const validateAnotherSymbol = createValidateFn<symbol>();

// the line comment hides this one completely
// @mion-expect-error validate-symbol-root
export const validateSymbolQuietly = createValidateFn<symbol>();
CommentPlacementWhat happens
// @mion-expect-error validate-symbol-rootits own linevalidate-symbol-root on the next line is hidden
// @mion-downgrade-error validate-symbol-rootits own linevalidate-symbol-root on the next line becomes a warning
/* @mion-expect-error validate-symbol-root */top of the fileevery validate-symbol-root in the file is hidden
/* @mion-downgrade-error validate-symbol-root */top of the fileevery validate-symbol-root in the file becomes a warning
/* @mion-expect-error */top of the fileevery error in the file is hidden
Always name the diagnostic. A comment with no name also hides errors you have not seen yet. A comment that turns nothing off is reported (comment-expect-error-unused or comment-downgrade-error-unused).

Downgrading Errors in Config

downgradeErrors turns the errors you list into warnings, across the whole project. Use it when you cannot add a comment: the type is in a package you do not own, or the problem is in your config. Only the tsconfig setting also lowers them in the linter.

mionVitePlugin({
  runTypes: {
    downgradeErrors: ['marker-comptime-arg-forbidden-construct'],
  },
});

A downgraded error still prints on every build:

node_modules/some-lib/adapter.js(41,9): warning marker-comptime-arg-forbidden-construct: ... (downgraded)

All the options are listed in Configuration.

'*' turns every error into a warning at once, useful when adding mion to an existing project. List the real names once you know them. An Error is never downgraded, not even by '*'.

Showing Info Messages

Info messages are hidden in the build, the mion command line and the linter. Set levels: 'all' in your tsconfig to show them in the build and the command line. The build plugin also has its own setting, and the linter shows them with its mion/info rule.

mionVitePlugin({
  runTypes: {
    levels: 'all',
  },
});

Grouping Messages

The build, the dev server and the mion command line print each message once, then every place it happens. A value that is the same in every place goes into the message.

error validate-non-data-root (2)
  Type `{type}` can never be validated: the generated function will always fail.
    src/routes/user.ts:12:7  type=FileHandle
    src/jobs/upload.ts:41:2  type=Socket

mion: 2 errors in 2 files

One Line per Message

Set logStyle: 'lines' to print one full line per message, the form CI tools read.

mionVitePlugin({
  runTypes: {
    logStyle: 'lines',
  },
});
Copyright © 2026