将 argon2 添加到您的解决方案时,是什么导致在 rollupjs 中“无法读取未定义的‘类型’的属性”

问题描述

我将我的代码与 rollupJs 捆绑在一起,它可以正常工作,直到我将 argon2 添加代码库中。 在添加 argon2 之前,我使用命名导出和其他加密函数工作正常。

rollup.config.js

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import json from '@rollup/plugin-json';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';

export default [
    {
        input: 'dist/js/src/index.js',output: {
            name: 'window',file: 'bundle.umd.js',format: 'umd',extend: true,exports: 'named'
        },plugins: [
            resolve({
                browser: true,dedupe: ['crypto','argon'],preferBuiltins: true
            }),commonjs(),builtins(),globals(),json()
        ],// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
        onwarn(warning) {
            // Skip certain warnings

            // should intercept ... but doesn't in some rollup versions
            if (warning.code === 'THIS_IS_UNDEFINED') {
                return;
            }

            // console.warn everything else
            console.warn(warning.message);
        }
    }
];

错误跟踪

the error when I add argon2 for hashing

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)