{"id":27388,"library":"sfc-compiler","title":"sfc-compiler","description":"A compiler for SFC (Single File Components) that provides rendering capabilities. Version 0.7.6 is the current stable release. Minimal documentation is available; the package is very simple with a single main export. It targets Node.js environments and uses CommonJS. There are no significant differentiators documented.","status":"active","version":"0.7.6","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install sfc-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add sfc-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add sfc-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The default export is an object with createCompiler method; direct require gives the whole module, not the compiler instance.","wrong":"const compiler = require('sfc-compiler');","symbol":"createCompiler","correct":"const { createCompiler } = require('sfc-compiler');"},{"note":"Call createCompiler() to get an instance with render method.","wrong":"const compiler = require('sfc-compiler'); compiler.render();","symbol":"compiler","correct":"const compiler = require('sfc-compiler').createCompiler();"},{"note":"render is a method on the compiler instance, not a direct export of the module.","wrong":"require('sfc-compiler').render();","symbol":"render","correct":"const compiler = require('sfc-compiler').createCompiler(); compiler.render();"}],"quickstart":{"code":"const compiler = require('sfc-compiler').createCompiler();\ncompiler.render();","lang":"javascript","description":"Shows how to create a compiler instance and call render."},"warnings":[{"fix":"Use require() instead of import.","message":"The package uses CommonJS; ES6 imports may not work directly without conversion.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use require('sfc-compiler').createCompiler() to get the compiler instance.","cause":"Calling require('sfc-compiler') returns the module object, not a compiler instance.","error":"TypeError: compiler.render is not a function"},{"fix":"Run npm install sfc-compiler","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'sfc-compiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}