# Server runtime - rollup not resolving imports from @types/node

**URL:** <https://forum.heroiclabs.com/t/server-runtime-rollup-not-resolving-imports-from-types-node/3622>\
**Category:** Local Setup\
**Tags:** server-framework, typescript\
**Created:** [March 15, 2023, 5:42am UTC](https://forum.heroiclabs.com/t/server-runtime-rollup-not-resolving-imports-from-types-node/3622 "2023-03-15T05:42:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seltzerfish](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/seltzerfish/32/1571_2.png) [@seltzerfish](https://forum.heroiclabs.com/u/seltzerfish)\
**Post date:** [March 15, 2023, 5:42am UTC](https://forum.heroiclabs.com/t/server-runtime-rollup-not-resolving-imports-from-types-node/3622/1 "2023-03-15T05:42:53Z")

</div>

Hello 🙂

I am trying to set up a Typescript server runtime using rollup, [as described in the docs](https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/#bundling-with-rollup). my rollup config looks exactly like the one from the docs.

I am installing a library called [jimp](https://www.npmjs.com/package/jimp) for image manipulation. Rollup seems to bundle most of jimp just fine, except for the dependencies on @types/node. See the first few lines of my transpiled index.js, which include several import statements:

```auto
import fs$4, { mkdir, stat as stat$1, statSync, mkdirSync } from 'fs';
import Path, { dirname, resolve, parse as parse$1 } from 'path';
import EventEmitter from 'events';
import Stream$3 from 'stream';
import http$1 from 'http';
import Url from 'url';
import require$$0$1 from 'punycode';
import https$1 from 'https';
import zlib$5 from 'zlib';
import require$$0$2 from 'util';
import require$$0$3 from 'assert';
import require$$3 from 'buffer';
import require$$3$1 from 'querystring';
import require$$1$1 from 'string_decoder';
import require$$4 from 'timers';

```

It seems that what these imports have in common is they are all from node\_modules/@types/node.  
To be clear, these import statements break my runtime in docker.

```auto
SyntaxError: index.js: Line 1:1 Unexpected reserved word

```

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [March 15, 2023, 1:30pm UTC](https://forum.heroiclabs.com/t/server-runtime-rollup-not-resolving-imports-from-types-node/3622/2 "2023-03-15T13:30:52Z")

</div>

Hey @seltzerfish our Typescript runtime isn’t a NodeJS runtime.

---

<div class="post-metadata">

**Author:** ![seltzerfish](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/seltzerfish/32/1571_2.png) [@seltzerfish](https://forum.heroiclabs.com/u/seltzerfish)\
**Post date:** [March 15, 2023, 4:22pm UTC](https://forum.heroiclabs.com/t/server-runtime-rollup-not-resolving-imports-from-types-node/3622/3 "2023-03-15T16:22:29Z")

</div>

Ahh i see. So does that mean it’s impossible to use npm libraries that rely on NodeJS, like Jimp? Do you have any other suggestions on how I might achieve server-side image manipulation?

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [March 15, 2023, 5:19pm UTC](https://forum.heroiclabs.com/t/server-runtime-rollup-not-resolving-imports-from-types-node/3622/4 "2023-03-15T17:19:54Z")

</div>

That’s correct. I personally would not write image manipulation code in Typescript. You should write it in Go. It somewhat depends though on what you are trying to do with the images.
