{"id":25051,"library":"canner-compiler","title":"Canner Compiler","description":"Canner Compiler is a compiler for Canner CMS schema that processes schema definitions and generates configurations for CMS rendering. The latest stable version is 3.2.1. It is part of the Canner CMS ecosystem and is used to compile schema written in Canner's declarative format. Key differentiators: integrates deeply with React (>=16.3) and provides validation via ajv, relation HOCs for data fetching, and route management. Releases are sporadic with incremental features.","status":"active","version":"3.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/Canner/canner","tags":["javascript","compiler","canner","CMS"],"install":[{"cmd":"npm install canner-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add canner-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add canner-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for component rendering","package":"react","optional":false},{"reason":"Peer dependency for DOM rendering","package":"react-dom","optional":false}],"imports":[{"note":"Package is ESM-only; no CommonJS support.","wrong":"const compiler = require('canner-compiler')","symbol":"default","correct":"import compiler from 'canner-compiler'"},{"note":"Named export available at package root, not subpath.","wrong":"import { compile } from 'canner-compiler/lib'","symbol":"compile","correct":"import { compile } from 'canner-compiler'"},{"note":"Directly import from package, not from source path.","wrong":"import { SchemaProvider } from 'canner-compiler/src/SchemaProvider'","symbol":"SchemaProvider","correct":"import { SchemaProvider } from 'canner-compiler'"}],"quickstart":{"code":"import compiler from 'canner-compiler';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nconst schema = {\n  type: 'object',\n  properties: {\n    title: { type: 'string' },\n    content: { type: 'string' }\n  }\n};\n\nconst compiled = compiler(schema);\n\nfunction App() {\n  return React.createElement('div', null, 'Compiled: ' + JSON.stringify(compiled));\n}\n\nReactDOM.render(React.createElement(App), document.getElementById('root'));","lang":"javascript","description":"Imports the compiler, compiles a simple CMS schema into a configuration object."},"warnings":[{"fix":"Use default import: import compiler from 'canner-compiler'.","message":"Upgrade from v1 to v2 changed the export name from 'cannerCompiler' to default export.","severity":"breaking","affected_versions":">=1.0.0 <2.0.0"},{"fix":"Use import compiler from 'canner-compiler'.","message":"The 'compile' function is deprecated in v3.0.0; use default import instead.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Upgrade React to >=16.3.","message":"Dropped support for React <16.3 in v3.0.0. Only React >=16.3 is supported.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install canner-compiler and use import compiler from 'canner-compiler'.","cause":"Package not installed or incorrect import path.","error":"Cannot find module 'canner-compiler'"},{"fix":"Use default import: import compiler from 'canner-compiler'.","cause":"Using named import incorrectly or using deprecated export.","error":"TypeError: compiler is not a function"},{"fix":"The 'compiled' object is configuration; it must be used with Canner CMS renderers, not directly rendered as a component.","cause":"Compiled output is an object, not a React element.","error":"Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}