Answer the question
In order to leave comments, you need to log in
Webpack require is not a function?
Why, when connecting koa-body
After processing with webpack, I get an error when starting the serverimport bodyParser from "koa-body";
var crypto = require('crypto');
^
TypeError: require is not a function
{
"presets": ["@babel/preset-env","@babel/preset-react"]
}
rules: [
{
test: /\.(m?js|jsx)$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
}
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question