---
title: MARKLESS_SHARED_METHOD_CROSS_MODULE
description: "A shared() method cannot be called from another module yet (<shared>): a Markless compiler error."
sidebar: { hidden: true }
search: { keywords: ["SHARED_METHOD_CROSS_MODULE","shared method cross module","markless error"] }
pagination: false
---

**Error** from the compiler, while it builds your `.tsrx` files.

## What happened

Markless prints the message, the reason, and a suggestion:

```text
MARKLESS_SHARED_METHOD_CROSS_MODULE: The emitted <kind> module for <symbolId> was built by copying the body of <shared> out of <files> into this file. <where> <what>
Calling a shared() method compiles to copying the method's authored body into the calling handler, because no shared instance exists inside a handler module to call the method on. Copying text moves the statements but not the scope they were written in, so the copy only means what the author wrote while the definition and the call are in one file. Across files the definition module's imports and module-scope declarations do not travel, and the calling module's imports are matched against the copied text by name, which can capture a same-named binding that means something else entirely. Both failures are invisible until the gesture runs, so this build refuses instead.
Call <value> from a part the family itself publishes, in <files>, and compose that part here. Inside its own module the same call compiles and runs today.
https://markless.dev/errors/MARKLESS_SHARED_METHOD_CROSS_MODULE
```

Words in angle brackets change from case to case.

## How to fix it

Start with the suggestion in the message above.

This page has no guide yet. [Help write it](/contributing/improve-these-docs).

## Where it comes from

`@markless/compiler` raises this code. Source:

- [packages/compiler/src/passes/symbol-modules.ts](https://github.com/compiled-run/markless/blob/main/packages/compiler/src/passes/symbol-modules.ts)

Read [how to read a Markless error](/tooling/diagnostics), or go back to [all error codes](/errors).
