我已经@svgr/webpack@6.0.0安装了 webpack 配置如下
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [
{
removeViewBox: false,
},
],
},
},
},
],
Run Code Online (Sandbox Code Playgroud)
但我收到如下错误:
Error: Plugin name should be specified
Run Code Online (Sandbox Code Playgroud) Amazon-cognito-identity-js,尝试更改经过身份验证的用户的密码时出现“callback.newPasswordRequired 不是函数”错误
const poolData = {
UserPoolId: 'eu-central-1_XXXXXXX'
ClientId: '2xxxxxxxxxxxxxxxxxxo',
}
const authenticationData = {
Username: name,
Password: oldPassword,
}
const authenticationDetails = new AuthenticationDetails(authenticationData)
const userPool = new CognitoUserPool(poolData)
const cognitoUser = new CognitoUser({ Username: name, Pool: userPool })
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess(result) {
cognitoUser.changePassword(oldPassword, newPassword, function (err, passwordChangeResult) {
if (err) {
console.warn(err.message || JSON.stringify(err))
}
console.warn(`Password change result: ${passwordChangeResult}`)
})
},
onFailure(err) {
console.warn(err)
},
})
return null
}
Run Code Online (Sandbox Code Playgroud)