nepodev / radio-browser

Nodejs module for Radio-browser API
MIT License
47 stars 9 forks source link

Module not found: Error: Can't resolve 'dns' #9

Closed onurusluca closed 2 years ago

onurusluca commented 2 years ago

Using with Vue3. Happens after importing. Not even using.

Failed to compile.

./node_modules/radio-browser/lib/dns-nativ.js Module not found: Error: Can't resolve 'dns' in 'node_modules\radio-browser\lib'

nepodev commented 2 years ago

The build procedure tries to include the dns module which is a native nodejs module. This module is not needed in a web frontend and should be ignored by the build procedure.

If you are using webpack then target: 'node' is required in webpack.config.js Add below configuration to your webpack.config.js

node: {
    dns: "empty"
}

Another option is to add below configuration to your package.json

"browser": {
   "dns": false
}