Use require in vue3 project with bun – not working: require is not defined

  Kiến thức lập trình

I have a question about using a common js package in a new vue3 project.
const io = require('') with an older version (v2).
However, it does not really matter which package I am requiring.

After realising that the browser will return ReferenceError: require is not defined I looked for alternatives and found that Bun should be able to handle all these problems:

It claims

In Bun, you can use import or require in the same file—they both work, all the time.

I thought, well perfect, that is what I need. I reinstalled all node_modules with bun and started the app $ bun dev.
But still I would get the same error.

Do I oversee something?