felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.32k stars 362 forks source link

Can't find variable: require #819

Closed MariuzM closed 1 month ago

MariuzM commented 1 month ago

I'm using Bun and when doing build with bun target i get this error.

Not sure if this is Bun related

Setup: Bun 1.1.27 "fastify": "^4.28.1", "@bull-board/api": "^5.21.6", "@bull-board/fastify": "^5.21.6",

image

This is from built file

image
MariuzM commented 1 month ago

Doing target node also same issue / error message

felixmosh commented 1 month ago

Try to pass uiBasePath option, which should point to ui package dir.

MariuzM commented 1 month ago

I'm not sure what path should i give it?

felixmosh commented 1 month ago

The ui package (node_modules/@bull-board/ui)

MariuzM commented 1 month ago

I have tried it like so but getting {"error":"Internal server error","message":"No such file or directory"}

        options: {
            uiConfig: {},
            uiBasePath: '/node_modules/@bull-board/ui/dist/index.ejs',
        },
felixmosh commented 1 month ago

It should be an absolute path to that dir... This is what the code with require does, resolves the path.

MariuzM commented 1 month ago

A got it thank you

            uiBasePath: path.resolve(__dirname, '../../node_modules/@bull-board/ui'),