{"id":26034,"library":"oc-template-react-compiler","title":"OpenComponents React Template Compiler","description":"Compiler for the React template in the OpenComponents (oc) ecosystem. Version 11.0.0 provides a Webpack-based build pipeline to transform React components into deployable OC packages. Primarily used internally by the oc-registry build process. It compiles JSX, handles asset bundling, and produces server-side renderable bundles. Releases follow the OpenComponents monorepo cadence. Differs from other React build tools by being tightly coupled to the OC registry workflow.","status":"active","version":"11.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/opencomponents/vite-templates","tags":["javascript","oc","opencomponents","react","oc-template","typescript"],"install":[{"cmd":"npm install oc-template-react-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add oc-template-react-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add oc-template-react-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for template compatibility","package":"oc-template-react","optional":true},{"reason":"bundling React components","package":"webpack","optional":false}],"imports":[{"note":"Default export is the Compiler class","symbol":"Compiler","correct":"import { Compiler } from 'oc-template-react-compiler'"},{"note":"compile is a named export, not default","wrong":"import compile from 'oc-template-react-compiler'","symbol":"compile","correct":"import { compile } from 'oc-template-react-compiler'"}],"quickstart":{"code":"import { Compiler } from 'oc-template-react-compiler';\nconst compiler = new Compiler({\n  component: { name: 'MyComponent', version: '1.0.0' },\n  path: './src',\n  oc: {registries: {}}\n});\ncompiler.compile().then(result => console.log(result));","lang":"typescript","description":"Creates a compiler instance for a React component and runs the build."},"warnings":[{"fix":"Upgrade to React 17 or 18, or pin to version 9.x if needed.","message":"Version 10.0.0 dropped support for React 16","severity":"breaking","affected_versions":">=10.0.0 <11.0.0"},{"fix":"Pass configuration directly as shown in quickstart.","message":"The `options` parameter in compiler constructor is deprecated","severity":"deprecated","affected_versions":">=9.0.0"},{"fix":"Ensure webpack 5 is installed as a devDependency.","message":"Requires webpack 5; webpack 4 will throw an error","severity":"gotcha","affected_versions":">=11.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install oc-template-react","cause":"Missing peer dependency oc-template-react","error":"Error: Cannot find module 'oc-template-react'"},{"fix":"Use: import { Compiler } from 'oc-template-react-compiler'; const compiler = new Compiler(...);","cause":"Importing wrong symbol (e.g., default import of Compiler class without instantiation)","error":"TypeError: compiler.compile is not a function"},{"fix":"Ensure babel-loader with @babel/preset-react is in webpack config.","cause":"Webpack configuration missing JSX loader","error":"Module parse failed: Unexpected token (1:0)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}