Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ReferenceError: exports is not defined #47

Open
domingotaal opened this issue Apr 23, 2024 · 1 comment
Open

[BUG] ReferenceError: exports is not defined #47

domingotaal opened this issue Apr 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@domingotaal
Copy link

Bug Description

I wanted to sign a transaction directly on postman. It seems it should be possible to dynamically load a library as shown below but it is not working

Steps to Reproduce

  1. In postman create a dummy request with the following Pre-request script
    pm.sendRequest("https://unpkg.com/@bsv/sdk", (err, res) => {
    //convert the response to text and save it as an environment variable
    pm.collectionVariables.set("bsv", res.text());

    // eval will evaluate the JavaScript code and initialize the min.js
    eval(pm.collectionVariables.get("bsv"));

//use the library to sign a transaction and broadcast it via ARC
})

  1. Send

Expected Behavior

Library is loaded and you can use it to sign, broadcast via ARC, etc.

Actual Behavior

Reference error: exports is not defined

Stack Traces or Screenshots

image

Environment

  • OS: Windows
  • Node version: n/a
  • @bsv/sdk version: 1.0.18

Additional Information

Not sure if this is actually a bug as this is a very specific use case

@domingotaal domingotaal added the bug Something isn't working label Apr 23, 2024
@domingotaal domingotaal changed the title [BUG] [BUG] ReferenceError: exports is not defined Apr 26, 2024
@sirdeggen sirdeggen added enhancement New feature or request and removed bug Something isn't working labels May 9, 2024
@sirdeggen
Copy link
Collaborator

More an environment incompatibility. Definitely worth investigating how to use the library in such an environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants