# Updating nakama above 3.10.0 breaks existing code because of read only \_getPrototypeOf

**URL:** <https://forum.heroiclabs.com/t/updating-nakama-above-3-10-0-breaks-existing-code-because-of-read-only-getprototypeof/2866>\
**Category:** Runtime Framework\
**Tags:** server-framework, typescript\
**Created:** [July 25, 2022, 3:49pm UTC](https://forum.heroiclabs.com/t/updating-nakama-above-3-10-0-breaks-existing-code-because-of-read-only-getprototypeof/2866 "2022-07-25T15:49:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MWFIAE](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mwfiae/32/678_2.png) [@MWFIAE](https://forum.heroiclabs.com/u/MWFIAE)\
**Post date:** [July 25, 2022, 3:49pm UTC](https://forum.heroiclabs.com/t/updating-nakama-above-3-10-0-breaks-existing-code-because-of-read-only-getprototypeof/2866/1 "2022-07-25T15:49:14Z")

</div>

Hi everyone!

My existing code base (that works fine with nakama server version 3.10.0) breaks if I update the server to 3.12.0

I’m getting the following error now for a specific:  
`TypeError: Cannot assign to read only property '_getPrototypeOf' at _getPrototypeOf`

For my setup, I’m using the typescript runtime with rollup and the following configuration:

```auto
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";
import pkg from "./package.json";
import builtins from "rollup-plugin-node-builtins";
import { defineConfig } from "rollup";

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

export default defineConfig({
    input: "./src/index.ts",
    external: ["nakama-runtime"],
    plugins: [
        // Allows node_modules resolution
        // throws weird errors, uncommented for now.
        resolve({ extensions }),
        builtins({ fs: true, builtins: false }),

        // Compile TypeScript
        typescript(),
        json(),
        // Resolve CommonJS modules
        commonJS({ extensions }),

        // Transpile to ES5
        babel({
            extensions,
            babelHelpers: "bundled",
        }),
    ],
    output: {
        file: pkg.main,
    },
});

```

The error occurs only on one endpoint because that endpoint uses luxon (successor of moment.js) to help me handle dates/timestamps.

Anybody got a clue what I can change to mitigate that error?  
Any reason why this now no longer functions as expected?

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [July 25, 2022, 5:55pm UTC](https://forum.heroiclabs.com/t/updating-nakama-above-3-10-0-breaks-existing-code-because-of-read-only-getprototypeof/2866/2 "2022-07-25T17:55:25Z")

</div>

Hi @MWFIAE,

There was a change made in Nakama 3.11.0 to make JavaScript Globals read-only to reduce the memory footprint. This behaviour can be reverted by changing the Nakama [`js_read_only_globals`](https://heroiclabs.com/docs/nakama/getting-started/configuration/#runtime.js_read_only_globals) value to `false`.

As a side, I would recommend reading through our consolidated [Release Notes](https://heroiclabs.com/docs/nakama/getting-started/release-notes/) when planning a server upgrade as this should hopefully help you identify any changes that may cause issues ahead of time.

Please let me know if this resolves your issue.

---

<div class="post-metadata">

**Author:** ![MWFIAE](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mwfiae/32/678_2.png) [@MWFIAE](https://forum.heroiclabs.com/u/MWFIAE)\
**Post date:** [July 25, 2022, 6:25pm UTC](https://forum.heroiclabs.com/t/updating-nakama-above-3-10-0-breaks-existing-code-because-of-read-only-getprototypeof/2866/3 "2022-07-25T18:25:30Z")

</div>

Hi @tom

That indeed did the trick! 🎉

I actually read the release notes before, but I didn’t connect the dots after I found this issue later 😄

Also I feel it would be really useful to include a section in the changelog about newly added config options. As without it there is no indication that the globals can actually be enabled again 🙂  
And there were a few times were I was wondering about new config options only to see that they don’t work and then realizing they are only available after an upgrade 😅

But anyways, thanks for your help and have a nice day! 🙂

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [July 26, 2022, 8:04am UTC](https://forum.heroiclabs.com/t/updating-nakama-above-3-10-0-breaks-existing-code-because-of-read-only-getprototypeof/2866/4 "2022-07-26T08:04:30Z")

</div>

Perfect, glad to hear you resolved the issue and thanks for the feedback. 🙂
