Skip to content
These are temporary community docs. The official docs are in progress.Help improve them
Markless
Esc
↑↓navigate↵open⌘Jpreview
On this page

MARKLESS_SHARED_COMPUTED_CROSS_MODULE

A shared() computed cannot be read from another module yet ("<name>"): a Markless compiler error.

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

What happened

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

MARKLESS_SHARED_COMPUTED_CROSS_MODULE: Serving this page works "<name>" out by copying its expression from <definedIn> into this file. The copied expression names "<name>", which <definedIn> means as its own, and THIS file already binds "<name>" as <text>; one module scope cannot hold both, and matched against it by name alone the served value would be built from this module's "<name>" rather than the one <definedIn> means.
A shared() factory has no instance on the server to ask for a computed value, so the server works the value out by copying the factory's own expression into the module of every page that reads it. The imports and module-scope constants that expression names travel with the definition and are emitted beside the copy, but a name this file already binds from somewhere else cannot be: the emitted module would bind it twice, and matching by name alone would build the served value from this module's value instead.
Rename this module's "<name>", or import it under another local name, so the one <definedIn> means can be carried in beside the copy.
https://markless.dev/errors/MARKLESS_SHARED_COMPUTED_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.

Where it comes from

@markless/compiler raises this code. Source:

Read how to read a Markless error, or go back to all error codes.

Was this page helpful?