微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决将 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 举报,一经查实,本站将立刻删除。