EJS - I can't run .ejs on netlify

I tried to run .ejs file on netlify
and I imported files from github

Here’s my github link - https://github.com/mineppl12/any-duck

as you see, in my build.js file,

ejs2html({
path: ${__dirname}/views/room.ejs,
outPath: ${__dirname}/public/index.html
});

However, if I run this,

<script>
    const ROOM_ID = "<%= roomId %>";
</script>

roomId is not defined

If i run this in
nodemon, nodemon server.js
there’s no problem at all.

Any idea to resolve this?

@mineppl12 Welcome to the Netlify community.

I’m not familiar with EJS, but if it needs a server to function, then it won’t work via the Netlify CDN-only delivery mechanism.