# Im getting thiss error when trying to use socket.io-client

**URL:** <https://forums.creativeclouddeveloper.com/t/im-getting-thiss-error-when-trying-to-use-socket-io-client/6537>\
**Category:** UXP Plugin API\
**Tags:** bug, javascript\
**Created:** [July 21, 2023, 2:59am UTC](https://forums.creativeclouddeveloper.com/t/im-getting-thiss-error-when-trying-to-use-socket-io-client/6537 "2023-07-21T02:59:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thaitq](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@thaitq](https://forums.creativeclouddeveloper.com/u/thaitq)\
**Post date:** [July 21, 2023, 2:59am UTC](https://forums.creativeclouddeveloper.com/t/im-getting-thiss-error-when-trying-to-use-socket-io-client/6537/1 "2023-07-21T02:59:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/7/73a1bcc2cb314274070157319f845ca374b707e2.png)

```auto
const io = require("socket.io-client");
const socket = io("ws://localhost:3001");

socket.on("connect", () => {
  console.log(socket.id)
})

```

I only just call this and the error already show. Please help.

---

<div class="post-metadata">

**Author:** ![Timothy\_Bennett](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/timothy_bennett/32/1251_2.png) [@Timothy\_Bennett](https://forums.creativeclouddeveloper.com/u/Timothy_Bennett)\
**Post date:** [July 21, 2023, 6:53am UTC](https://forums.creativeclouddeveloper.com/t/im-getting-thiss-error-when-trying-to-use-socket-io-client/6537/2 "2023-07-21T06:53:54Z")

</div>

UXP isn’t Node and so you can’t use modules without using a bundler such as Webpack.

> [@Is there way to include other JavaScript source?](http://forums.creativeclouddeveloper.com/t/is-there-way-to-include-other-javascript-source/3408/8):
>
> Note that if you’re not using webpack, you’ll need to use relative paths. The require function does not do node-style resolution or lookup. As such: require("module.js") will fail because it’s not relative. Using require("./module.js") will work, assuming it’s in the same directory. If you’ve got node\_modules/commonLib.js, you’ll need to use require("./node\_modules/commonLib.js") (assuming main.js is i Be sure to also use module.exports = {/\*...\*/} when doing this (ES6-style exports are not …
