Answers for "music-metadata-browser Buffer is not defined"

CSS
0

music-metadata-browser Buffer is not defined

//In webpack.config.js add (or add to) plugins and resolve 

const webpack = require('webpack');

module.exports = {
    plugins: [
        new webpack.ProvidePlugin({
            Buffer: ['buffer', 'Buffer'],
        }),
        new webpack.ProvidePlugin({
            process: 'process/browser',
        }),
    ],
    
    resolve: {
        extensions: [ '.ts', '.js' ],
        fallback: {
            "stream": require.resolve("stream-browserify"),
            "buffer": require.resolve("buffer")
        }
    },
Posted by: Guest on October-28-2021

Browse Popular Code Answers by Language