algorand / algorand/js-algorand-sdk

Remove dependency on js-sha256

未關閉
#697 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
new-feature-request Team Scytale
主要語言
TypeScript
星號
297
分支
214
平均合併
1 小時 3 分鐘
30 天內合併 PR
3

描述

## Problem

The old package js-sha256 uses require() and thus causes problems running in a browser context. See issue [https://github.com/emn178/js-sha256/issues/33](https://github.com/emn178/js-sha256/issues/33) on the repo suggesting that it be deprecated.

## Solution

Use the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) or an alternative package that can run in the browser for client-side applications.

## Dependencies

## Urgency

Using the JS Algo SDK breaks Vite builds. Example error message below:

`undefined:1
require('crypto')
^

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/Users/brianwhippo/Code/alright-solid/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at eval (eval at nodeWrap (file:///Users/name/Code/alright-solid/dist/server-0978c76d.js:30849:19), :1:1)`

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。