admin-no-medusa-utils-import - ESLint plugin rules
This rule disallows importing Node-only modules from the Medusa Framework (@medusajs/framework/utils, @medusajs/framework/http, and @medusajs/framework/workflows-sdk) in admin code, since they break the browser bundle.
Severity#
error. This rule is enabled in the recommended preset.
What it Targets#
This rule targets files in your project's src/admin directory. It reports an import or re-export of a Node-only module from the Medusa Framework.
The following code is reported by the rule:
Instead, move the logic to the server and call it from the admin via the JS SDK:
Why it's Important#
The admin dashboard is a browser bundle. Importing Node-only modules breaks the admin build or ships server-only code to the client.
Learn more in the Admin Development documentation.
Fixable#
This rule isn't auto-fixable.