{"id":17658,"library":"fusion-cli","title":"Fusion.js CLI","description":"The `fusion-cli` is the command-line interface for the Fusion.js framework, designed to orchestrate the development lifecycle of universal React applications. It handles compile-time configurations for both server and browser bundles, facilitating development, testing, and production deployments. Key features include a standardized Babel configuration with modern ECMAScript support, efficient hot module reloading, and an integrated web server. Fusion.js, originally developed by Uber, focuses on high performance, server-side rendering (SSR), and a modular, plugin-driven architecture, enabling seamless transitions between client and server logic. As of the provided npm data, the current version is 2.39.1. However, the last recorded release in the excerpt is from October 2022, and the broader Fusion.js project on GitHub shows minimal recent activity, suggesting a slow or halted development cadence for the framework. It emphasizes a strict, opinionated build process, notably not supporting custom Webpack configurations to maintain internal consistency and facilitate future bundler transitions.","status":"abandoned","version":"2.39.1","language":"javascript","source_language":"en","source_url":"https://github.com/fusionjs/fusionjs","tags":["javascript"],"install":[{"cmd":"npm install fusion-cli","lang":"bash","label":"npm"},{"cmd":"yarn add fusion-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add fusion-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for the Fusion.js framework.","package":"fusion-core","optional":false},{"reason":"Primary UI library for Fusion.js applications.","package":"react","optional":false},{"reason":"DOM renderer for React applications.","package":"react-dom","optional":false},{"reason":"Testing utility for React components.","package":"enzyme","optional":true},{"reason":"Often used for data fetching with plugins like fusion-plugin-apollo.","package":"graphql","optional":true}],"imports":[{"note":"The primary class for instantiating a Fusion.js application, typically a default export from 'fusion-react'.","wrong":"import { App } from 'fusion-react'","symbol":"App","correct":"import App from 'fusion-react'"},{"note":"Function used to define and create Fusion.js plugins, a named export from 'fusion-core'.","wrong":"import createPlugin from 'fusion-core'","symbol":"createPlugin","correct":"import { createPlugin } from 'fusion-core'"},{"note":"A common plugin for routing in Fusion.js applications, typically a default export.","wrong":"import { Router } from 'fusion-plugin-react-router'","symbol":"Router","correct":"import Router from 'fusion-plugin-react-router'"}],"quickstart":{"code":"import React from 'react';\nimport App from 'fusion-react';\nimport {createPlugin} from 'fusion-core';\nimport Router from 'fusion-plugin-react-router';\nimport {SessionToken} from 'fusion-tokens';\nimport JWTSession from 'fusion-plugin-jwt';\n\n// Define a simple root component\nconst Root = () => <div>Hello Fusion.js!</div>;\n\n// Create and export the Fusion.js app\nexport default () => {\n  const app = new App(<Root />);\n\n  // Register common plugins like Router and Session\n  app.register(Router);\n  app.register(SessionToken, JWTSession);\n\n  // Example of a custom plugin logging requests\n  const MyPlugin = createPlugin({\n    provides() {\n      return {\n        logMessage: (message) => console.log(`MyPlugin: ${message}`),\n      };\n    },\n    middleware(deps, middleware) {\n      return async (ctx, next) => {\n        deps.logMessage(`Request received for path: ${ctx.path}`);\n        await next();\n      };\n    },\n  });\n  app.register(MyPlugin);\n\n  return app;\n};\n","lang":"javascript","description":"This quickstart demonstrates the core structure of a Fusion.js application using `fusion-cli`, showing app initialization, plugin registration, and a basic custom plugin."},"warnings":[{"fix":"Instead of custom Webpack configurations, leverage Fusion.js's plugin architecture and `.fusionrc.js` for build-time customizations. If a feature is truly missing, consider contributing to the Fusion.js project or creating a feature request.","message":"Fusion.js, and by extension `fusion-cli`, does not support custom `webpack.config` files. This is a deliberate design choice to maintain consistency and allow the framework to evolve its internal bundling mechanisms. Any attempts to provide a custom Webpack configuration will be ignored or lead to unexpected behavior.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace `--testFolder <path>` with `--testMatch '<glob-pattern>'` or `--testRegex '<regexp-string>'` in your `package.json` scripts or CLI commands.","message":"The `--testFolder` CLI option is deprecated. Developers should migrate to using `--testMatch` or `--testRegex` for specifying test file locations.","severity":"deprecated","affected_versions":">=2.34.0"},{"fix":"Always use `yarn fusion build` or `npx fusion build` before `yarn fusion start` for production or staging environments. `yarn fusion dev` is for development with Hot Module Reloading.","message":"When running Fusion.js applications, the `fusion dev` command builds browser artifacts in memory and does not save them to the filesystem. In contrast, `fusion build` saves artifacts to disk. If you intend to run a previously built application using `fusion start`, you *must* use `fusion build` first; running `fusion start` after `fusion dev` will fail due to missing build artifacts.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure your application and all Fusion.js-related plugins are compatible with React 18. Update `react` and `react-dom` peer dependencies accordingly. Review React 18 upgrade guides for potential breaking changes in your application code.","message":"Fusion.js CLI version 2.35.0 updated the React dependency to 18.2.0. Applications using older React versions might encounter compatibility issues or require updates to React-related packages and code patterns to align with React 18's changes (e.g., `createRoot`).","severity":"breaking","affected_versions":">=2.35.0"},{"fix":"Rely on the CLI commands (e.g., `fusion dev`, `fusion build --production`) to set the appropriate `NODE_ENV`. If specific build behaviors depend on `NODE_ENV`, ensure they are configured within the `.fusionrc.js` or via plugin options that respond to the CLI-inferred environment.","message":"The `fusion-cli` infers the `NODE_ENV` environment variable from the initiating CLI command and its flags. It cannot be manually configured through environment variables directly and attempts to override it may be ignored or lead to unexpected build outcomes.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Run `fusion <command>` where `<command>` is one of the available subcommands like `fusion dev`, `fusion build`, or `fusion start`. You can see all available commands with `fusion help`.","cause":"The `fusion` command was executed without specifying a subcommand (e.g., `dev`, `build`, `start`).","error":"No command given. Type 'fusion help' for more information."},{"fix":"Verify that all required plugins are correctly registered using `app.register()` in your `src/main.js` or similar entry point. Inspect the stack trace to identify the problematic plugin and ensure its dependencies are satisfied. Check for proper initialization of values within the plugin's `provides` method.","cause":"This error, often seen in Fusion.js applications, typically indicates an issue with a plugin trying to access a property on an undefined object, frequently within context (`ctx`) or a plugin's dependency (`deps`). It suggests a missing dependency, incorrect plugin registration, or an unexpected state in the application context.","error":"Cannot read property 'sub' of undefined"},{"fix":"Ensure your Node.js, Yarn, and npm versions meet the `engines` requirements. For Fusion.js projects, ensure you are using the correct Yarn version (historically Yarn v2/Berry) and have run `yarn install` at the monorepo root. Address any specific dependency installation errors.","cause":"These generic errors often point to issues with package manager versions (Yarn/npm), Node.js version incompatibilities, or underlying build tool problems (like `iltorb` module deprecation as seen in some issues). Fusion.js is a monorepo that historically used Yarn v2 (now Yarn Berry).","error":"Fresh install not working / Unable to install dependencies from fresh clone of master"},{"fix":"This is a minor aesthetic issue and does not generally impact the build process or output. No direct fix for users, as it's an internal CLI behavior.","cause":"A known issue where the build completion message is redundantly printed twice in the console output.","error":"Build completed (printed twice)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}