此平台不支持 Nodebuffer
Nodebuffer is not supported by this platform
我的代码 运行 进入了这个平台错误不支持的 Nodebuffer。
完整错误信息:
node buffer is not supported by this platform in reacts, type of file reader. the result is ArrayBuffer(55826922)
代码:
import * as shp from 'shpjs'
shp(fileReader.result) // generate this error
任何帮助将不胜感激
1) npm install -S buffer
2) // vue.config.js
const { ProvidePlugin } = require('webpack');
module.exports = {
configureWebpack: {
resolve: {
fallback: {
buffer: require.resolve('buffer/'),
},
},
plugins: [
new ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
},
};
我的代码 运行 进入了这个平台错误不支持的 Nodebuffer。
完整错误信息:
node buffer is not supported by this platform in reacts, type of file reader. the result is ArrayBuffer(55826922)
代码:
import * as shp from 'shpjs'
shp(fileReader.result) // generate this error
任何帮助将不胜感激
1) npm install -S buffer
2) // vue.config.js
const { ProvidePlugin } = require('webpack');
module.exports = {
configureWebpack: {
resolve: {
fallback: {
buffer: require.resolve('buffer/'),
},
},
plugins: [
new ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
},
};