我正在使用fuse-box构建React和Node(express)应用程序
const ap = express()
导致此错误:
`path/to/projct/react/react-skeleton/build/ssr/development/bundle.js:7624
require("./streams")(iconv);
^
TypeError: require(...) is not a function
.
.
.`
这是fuse.js文件的babel配置:
let babelPresetEnv = [
'env',
{
targets: {
browsers
},
}
]
_.BabelPlugin({
config: {
sourceMaps: true,
presets: ['react', 'stage-0', babelPresetEnv],
plugins: [
'babel-plugin-transform-decorators-legacy',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-object-rest-spread',
'babel-plugin-transform-es2015-spread',
'babel-plugin-transform-object-assign'
].map(require.resolve)
}
}),
我完全没有解决它..提前感谢..
我尝试了一切,最后降级快递解决了它:"express": "4.15.4",