ESBUILD build fails in gramex 1.91.1 in alpine container

38 Views Asked by At

So A container is running in Gramex IDE with following details

$ cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.17.1
PRETTY_NAME="Alpine Linux v3.17"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
$
$ gramex --version
Gramex version: 1.91.1
Gramex path: /home/gramex/conda/lib/python3.9/site-packages/gramex
Python version: 3.9.16
Python path: /home/gramex/conda/bin/python
$
$ node --version
v16.19.1
$ npm --version
8.10.0

and I have this TS file with exports as /app/ts/index.ts

It failed in gramex server hence I tried running the underlying command in the terminal as:

cd /app/ts
node /home/gramex/conda/lib/python3.9/site-packages/gramex/apps/ui/node_modules/esbuild/bin/esbuild --format=esm --bundle =true --minify=false --target=esnext --charset=utf8 --global-name= --keep-names=false --allow-overwrite --sourcemap --outdir=/home/gramex/.config/gramexdata/apps/ui/.ts-51554 index.ts

And this command fails as well with error:

/home/gramex/conda/lib/python3.9/site-packages/gramex/apps/ui/node_modules/esbuild/bin/esbuild:1
ELF
^

SyntaxError: Invalid or unexpected token
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1119:15)
    at Module._compile (node:internal/modules/cjs/loader:1155:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47

Already tried reinstalling esbuild in UI directory.

1

There are 1 best solutions below

1
On

Use npx instead of node in the command.