isomor-react-app

raw JSON →
2.6.4 verified Fri May 01 auth: no javascript

React application setup package for the Isomor framework (v2.6.4). Isomor enables full-stack TypeScript development in a single project by auto-generating the API layer between frontend and backend, eliminating the need for explicit REST or GraphQL endpoints. It uses Babel transpilation at compile time to split client and server code. Release cadence is irregular; latest stable is v2.6.x. Key differentiator: seamless function calls from UI to server with full type safety, no boilerplate.

error Uncaught TypeError: IsomorReactApp is not a constructor
cause Using named import instead of default import in ESM, or forgetting .default in CJS
fix
ESM: import IsomorReactApp from 'isomor-react-app'; CJS: const IsomorReactApp = require('isomor-react-app').default;
error Error: Cannot find module 'isomor'
cause Missing peer dependency 'isomor'.
fix
Run 'npm install isomor'.
error TypeError: app.start is not a function
cause Importing wrong module or using older version without start method?
fix
Ensure you imported the default export. For v2.x, start is a function; if using v1, use 'app.init()' instead.
gotcha IsomorReactApp must be instantiated before any server-side imports are resolved, otherwise transpilation may fail.
fix Ensure 'new IsomorReactApp({...})' is called at the entry point before dynamic imports of server functions.
deprecated The 'start' method in v2.x is synchronous; it will become async in v3.
fix Wrap in an async function to prepare for v3: 'await app.start()'.
breaking In v2.0, the constructor option 'serverDir' replaced 'serverFolder'.
fix Use 'serverDir' instead of 'serverFolder'.
gotcha Server functions must be dynamically imported with import() to allow isomor to transpile them at build time.
fix Use dynamic imports like 'import('./server/api').then(...)' instead of static imports.
breaking Isomor v2.6 requires Node >=11; older Node versions will throw on start.
fix Upgrade Node to v11 or later.
npm install isomor-react-app
yarn add isomor-react-app
pnpm add isomor-react-app

Sets up an Isomor React application with server directory, port, and a demo component that calls a server function directly.

import IsomorReactApp from 'isomor-react-app';
import React from 'react';
import ReactDOM from 'react-dom';

const app = new IsomorReactApp({
  serverDir: './server',
  port: process.env.PORT ?? '4000',
});

app.start();

function App() {
  const [message, setMessage] = React.useState('');
  React.useEffect(() => {
    // Direct server function call (generated by isomor)
    import('./server/api').then(({ getMessage }) => {
      getMessage().then(setMessage);
    });
  }, []);
  return <div>{message}</div>;
}

ReactDOM.render(<App />, document.getElementById('root'));