felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.36k stars 366 forks source link

Can't find variable: require #819

Closed MariuzM closed 2 months ago

MariuzM commented 2 months 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 2 months ago

Doing target node also same issue / error message

felixmosh commented 2 months ago

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

MariuzM commented 2 months ago

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

felixmosh commented 2 months ago

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

MariuzM commented 2 months 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 2 months ago

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

MariuzM commented 2 months ago

A got it thank you

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