Registry / devops / online-compiler-widget

online-compiler-widget

JSON →
library1.0.31jsnpmunverified

An online compiler widget for React applications, wrapping @xyflow/react to provide an embeddable code compilation interface. Current stable version is 1.0.31 with monthly updates. Key differentiators: built on top of @xyflow/react for visual programming with code compilation, supports React 18 and 19, and includes TypeScript definitions. It is designed for embedding in educational or coding tools that require interactive code execution.

npm install online-compiler-widget
INSTALL
IMPORT
SIG · ONLINE-COMPILER-WI
O
online-compiler-widget
devopsjavascriptv1.0.31
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OnlineCompilerWidget
✓ import { OnlineCompilerWidget } from 'online-compiler-widget'
✗ const OnlineCompilerWidget = require('online-compiler-widget')
ESM-only; use named import. Do not default import.
useCompiler
✓ import { useCompiler } from 'online-compiler-widget'
Named hook for accessing compiler state.
CompilerProvider
✓ import { CompilerProvider } from 'online-compiler-widget'
✗ import CompilerProvider from 'online-compiler-widget'
Named import, not default. Required as context provider.

Shows the minimal setup: wrapping the OnlineCompilerWidget inside ReactFlowProvider from @xyflow/react, both of which are required.

import { OnlineCompilerWidget } from 'online-compiler-widget'; import { ReactFlowProvider } from '@xyflow/react'; function App() { return ( <ReactFlowProvider> <OnlineCompilerWidget /> </ReactFlowProvider> ); } export default App;
Debug
Known issues
breakingRequires @xyflow/react v12+ as a peer dependency. Using older versions will cause runtime errors.
fix
Install @xyflow/react@^12.0.0 and ensure it is included in your project dependencies.
affects: >=1.0.0
gotchaThe widget must be wrapped in ReactFlowProvider from @xyflow/react, otherwise it will throw an error.
fix
Wrap the widget with <ReactFlowProvider> at an appropriate level in the component tree.
affects: >=1.0.0
deprecatedVersion 1.0.x uses the old compiler API. Newer APIs may be introduced in future versions.
fix
Watch for updates and migrate when breaking changes occur.
affects: 1.0.x
Errors
Common errors & fixes
Error: @xyflow/react is not installed or version mismatch
Missing or incompatible peer dependency @xyflow/react.
fix
Run `npm install @xyflow/react@^12.0.0`
TypeError: Cannot read properties of undefined (reading 'getNodes')
The component is not wrapped in ReactFlowProvider.
fix
Wrap the OnlineCompilerWidget with <ReactFlowProvider> from '@xyflow/react'.
Module not found: Can't resolve 'online-compiler-widget'
Package not installed or import path incorrect.
fix
Run `npm install online-compiler-widget` and ensure the import is correct: `import { OnlineCompilerWidget } from 'online-compiler-widget'`.
Upgrade
Version history
1.0.31latest on npm
Audit
Dependencies
@xyflow/reactrequiredPeer dependency used for rendering the widget's flow-based UI
reactrequiredPeer dependency required as it is a React component
react-domrequiredPeer dependency for DOM rendering
Agent activity
8 hits · last 30 days
node
8
Resources
online-compiler-widget — npm install online-compiler-widget · libregistry