parcel-bundler/parcel · error · ThrowableDiagnostic

No preprocessor found for block type ${type}

Error message

No preprocessor found for block type ${type}

What it means

Thrown by @parcel/transformer-vue when a custom block (<template lang="xxx" block> or a top-level custom block tag of the given type) has no matching handler registered in vue.config.js customBlocks. The transformer iterates customBlocks and looks up config.customBlocks[type]; absence is fatal.

Source

Thrown at packages/transformers/vue/src/VueTransformer.js:439

  });
};`
    : ''
}
export default cssModules;`,
        });
      }
      return assets;
    }
    case 'custom': {
      let toCall = [];
      // To satisfy flow
      if (!config) return [];
      let types = new Set();
      for (let block of customBlocks) {
        let {type, src, content, attrs} = block;
        if (!config.customBlocks[type]) {
          // TODO: codeframe
          throw new ThrowableDiagnostic({
            diagnostic: {
              message: md`No preprocessor found for block type ${type}`,
              origin: '@parcel/transformer-vue',
            },
          });
        }
        if (src) {
          content = (
            await options.inputFS.readFile(await resolve(asset.filePath, src))
          ).toString();
        }
        toCall.push([type, content, attrs]);
        types.add(type);
      }
      return [
        {
          type: 'js',
          uniqueKey: asset.id + '-custom',

View on GitHub (pinned to 59484858a1)

Solutions

  1. Register the block type in vue.config.js: `module.exports = { customBlocks: { docs: { preprocess: ... } } }`.
  2. Remove the custom block from the SFC if it is no longer needed.
  3. Fix the typo so the block tag matches a registered customBlocks key.

Example fix

// before (vue.config.js)
module.exports = { customBlocks: {} };
// SFC: <docs>some doc</docs>
// after
module.exports = { customBlocks: { docs: { preprocess: 'text' } } };
Defensive patterns

Strategy: validation

Validate before calling

const registered = Object.keys(config?.customBlocks || {});
const used = customBlocks.map(b => b.type);
const missing = used.filter(t => !registered.includes(t));
if (missing.length) throw new Error('Unregistered custom block types: ' + missing.join(', '));

Type guard

function allCustomBlocksRegistered(customBlocks, config) {
  const registered = new Set(Object.keys(config?.customBlocks || {}));
  return customBlocks.every(b => registered.has(b.type));
}

Prevention

When it happens

Trigger: An SFC contains a custom block (e.g. <docs>, <i18n>, <story>) whose type is not a key in the customBlocks object returned from vue.config.js.

Common situations: Adding a documentation/i18n block without registering its processor in vue.config.js, removing a customBlocks entry while SFCs still use the block, or a typo in the block tag name.

Related errors


AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13). Data as JSON: /api/errors/d2ba1ca7ca370209. Report an issue: GitHub.