#2565·quartz

`quartz.ts` overrides fail for scoped npm plugins due to registry key mismatch

Author: WhoAmI-WhereAmICreated Sep 23, 2026Updated Sep 23, 2026
Labelsbug

Description

As previously noted in #2382 , the documented quartz.ts plugin override syntax does not work for scoped npm plugins:

typescript
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
import * as ExternalPlugin from "./.quartz/plugins"

ExternalPlugin.Explorer({
  filterFn: (node) => {
    // ...
  },
})

const config = await loadQuartzConfig()
export default config
export const layout = await loadQuartzLayout()

However, directly setting the override through componentRegistry works:

typescript
import { componentRegistry } from "./quartz/components/registry"

componentRegistry.setOptionOverrides("@quartz-community/explorer", {
  filterFn: (node) => {
    // ...
  },
})

This appears to be caused by a mismatch between the registry key generated in .quartz/plugins/index.ts and the key used by config-loader.ts.

Cause

Here I will explicitly use @quartz-community/explorer as an example. In quartz/plugins/loader/gitLoader.ts, scoped npm package names are sanitized when generating the plugin index:

typescript
const key = npmPkg.replace(/^@/, "").replace(/\//g, "__")     //quartz-community__explorer

This sanitized key is then also used when generating the override wrapper:

typescript
componentRegistry.setOptionOverrides("quartz-community__explorer", options)

However, config-loader.ts retrieves overrides using spec.name:

typescript
const spec = parsePluginSource(entry.source)
const pluginOverrides = componentRegistry.getOptionOverrides(spec.name)

parsePluginSource() preserves the original npm package name, so:

typescript
spec.name === "@quartz-community/explorer"

The override is stored under quartz-community__explorer but retrieved under @quartz-community/explorer. This must be why getOptionOverrides() returns undefined.