# Error during installing Nakama Typescript Server Runtime

**URL:** <https://forum.heroiclabs.com/t/error-during-installing-nakama-typescript-server-runtime/3218>\
**Category:** Local Setup\
**Tags:** server-framework, typescript\
**Created:** [October 31, 2022, 2:21pm UTC](https://forum.heroiclabs.com/t/error-during-installing-nakama-typescript-server-runtime/3218 "2022-10-31T14:21:56Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![KamilDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/kamildev/32/2454_2.png) [@KamilDev](https://forum.heroiclabs.com/u/KamilDev)\
**Post date:** [January 18, 2025, 1:43pm UTC](https://forum.heroiclabs.com/t/error-during-installing-nakama-typescript-server-runtime/3218/19 "2025-01-18T13:43:22Z")

</div>

Solution: The `rollup.config.mjs` provided in the documentation is not correct or outdated.

Searching the forum, I came across this message:

> [@TypeScript Runtime Setup](https://forum.heroiclabs.com/t/typescript-runtime-setup/5088/2):
>
> Hello @Wobling, If your intent is to use rollup I suggest you work backwards and use our [project template with rollup](https://github.com/heroiclabs/nakama-project-template/tree/spe/rollup) as a baseline and modify the source files with your own source code, as the guide may be a bit outdated at this point. Delete the Go and Lua source files if you’re not using those runtimes. Hope this helps.

If you do not plan on updating this documentation, then **please** add a disclaimer at the top, and save people the pain of unknowingly getting stuck trying to get an outdated tutorial to work.

If I replace the `rollup.config.mjs` contents provided by the tutorial with the version found in the [GitHub repo](https://github.com/heroiclabs/nakama-project-template/tree/spe/rollup):

```js
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import babel from "@rollup/plugin-babel";
import typescript from "@rollup/plugin-typescript";

const extensions = [".mjs", ".js", ".ts", ".json"];

export default {
  input: "./src/main.ts",
  external: ["nakama-runtime"],
  plugins: [
    // Compile TS to check types
    typescript(),

    // Allows node_modules resolution
    resolve(),

    json(),

    // Resolve CommonJS modules
    commonjs(),

    // Compile TS and build to ES5
    babel({
      extensions: extensions,
      babelHelpers: "bundled",
    }),
  ],
  output: {
    format: "cjs",
    file: "build/index.js",
  },
};

```

The built JavaScript is now correct and Nakama starts up correctly:

```js
'use strict';

function InitModule(ctx, logger, nk, initializer) {
  logger.info("TypeScript module loaded.");
}
!InitModule && InitModule.bind(null);

```

---

_[View the full topic](https://forum.heroiclabs.com/t/error-during-installing-nakama-typescript-server-runtime/3218)._
