Library compatibility with Secure EcmaScript
See original GitHub issueSecure EcmaScript proposal: https://github.com/tc39/proposal-ses
Steps to reproduce:
Only way we know how to reproduce is to run build on: https://github.com/NodeFactoryIo/metamask-snap-polkadot/tree/feature/connect-to-node
Error:
Build success: 'build/index.js' bundled as 'dist/bundle.js'!
Snap evaluation error: possible import expression rejected around line 8527
Code:
Which makes no sense as that line contains comment so it might be due to snap evaluation code.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Securing JavaScript Modules - Medium
Support for ECMAScript modules has been released in SES (Secure ECMAScript) version 0.8.0. Generally, SES refers to an effort to introduce ...
Read more >Draft proposal for SES (Secure EcmaScript) - GitHub
Most legacy code obeying this practice is already compatible with lightweight realms descending from an immutable root realm. Some further qualifications are ...
Read more >Writing robust client-side code using Modern JavaScript
Supports JSX as well. • Microsoft TypeScript: technically not ES6 but roughly a superset of ES6. Bonus: type inference and optional static typing....
Read more >ecmascript-library-template - npm package - Snyk
Is ecmascript-library-template safe to use? The npm package ecmascript-library-template was scanned for known vulnerabilities and missing license, and no ...
Read more >ECMAScript® 2023 Language Specification - TC39
The ECMAScript library of built-ins was expanded to support additional data ... They might do so in the interests of security, to avoid...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
1.8.0-beta.10
allows theinitWasm: false
flag which would skip init on the API level itself. Please give it a try as see if it gets down the road somewhat. (As mentioned, not having wasm means no sr25519 support, which depending on use is ok or not)The util-crypto will still try imports from wasm-crypto in the utils to determine which path to take, i.e. if wasm is available it will use that, otherwise fallback. If this creates an issue, there would need to be some magic in the util-crypto done.
So if the flag itself does not get over the line, the stub of wasm-crypto is the other approach. In the project package.json -
Where the
noWasm.js
file has the following -waitReady
is what is called on initisReady
is what is called when the libs determine which path to take(This is the hammer approach, even without the flag introduced it will just stub out the wasm completely, all ok for any hashing or ed25519 keys that can take either route)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.