{"id":25206,"library":"embark-compiler","title":"embark-compiler","description":"Embark compiler module that abstracts the compiler interface and exposes a plugin API for contract extensions. Current stable version is 6.0.0, part of the Embark framework (release cadence: major versions every 6-12 months, nightly releases). Key differentiators: integrates with Solidity (solc), supports plugin-based compiler registration, and provides a command-driven compilation flow. Compared to alternatives like Truffle Compile, it is tightly coupled with the Embark ecosystem and uses a unique event-based request pattern.","status":"active","version":"6.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/embarklabs/embark","tags":["javascript","blockchain","dapps","ethereum","ipfs","serverless","solc","solidity","typescript"],"install":[{"cmd":"npm install embark-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add embark-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add embark-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the Embark runtime, events, and plugin system","package":"@embark/core","optional":false}],"imports":[{"note":"File class is part of embark-core, not embark-compiler. ESM import required.","wrong":"const { File } = require('embark-compiler')","symbol":"File","correct":"import { File } from 'embark-core'"},{"note":"This is an event request, not a direct import. Used via the Embark events system.","symbol":"compiler:contracts:compile","correct":"embark.events.request('compiler:contracts:compile', contractFiles, options, callback)"},{"note":"registerCompiler is a plugin API method on the plugins object, not a named export.","wrong":"require('embark-compiler').registerCompiler(...)","symbol":"registerCompiler","correct":"plugins.registerCompiler('extension', callback)"}],"quickstart":{"code":"import { File } from 'embark-core';\nconst contractFiles = [new File({\n  path: 'SimpleStorage.sol',\n  type: 'custom',\n  resolver: (cb) => cb('pragma solidity ^0.5.0; contract SimpleStorage { uint storedData; }')\n})];\nembark.events.request('compiler:contracts:compile', contractFiles, { isCoverage: false }, (err, compiledObject) => {\n  if (err) { console.error(err); return; }\n  console.log('Bytecode:', compiledObject.runtimeBytecode);\n});","lang":"typescript","description":"Compiles a Solidity contract using Embark's event-based request system, showing the minimal setup with a File object."},"warnings":[{"fix":"Upgrade Node to >=10.17.0 and npm to >=6.11.3 or yarn >=1.19.1.","message":"embark-compiler v6.0.0 drops support for Node <10.17.0 and npm <6.11.3.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Use the event-based request pattern instead (compiler:contracts:compile).","message":"The old callback-based plugin API (registerCompiler) may be removed in future versions.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Always set type: 'custom' or appropriate value when creating File instances.","message":"File objects must include a 'type' property; omitting it may cause errors.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Pass { isCoverage: false } if not using coverage.","message":"Compilation options parameter is required and must include isCoverage (boolean).","severity":"gotcha","affected_versions":">=6.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 @embark/core' or ensure Embark framework is properly installed.","cause":"embark-core is a peer dependency not automatically installed.","error":"Cannot find module 'embark-core'"},{"fix":"Set path to the contract's original filename, e.g., 'SimpleStorage.sol'.","cause":"File path does not match the contract's actual file path in the resolver.","error":"Error: ContractSimpleStorage.sol not found"},{"fix":"Wrap File in an array: [new File({...})].","cause":"File objects passed in an incorrect format or not an array.","error":"TypeError: contractFiles is not iterable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}