blockfrost / blockfrost-js

Node.js SDK for the Blockfrost.io API.
https://blockfrost.io
Apache License 2.0
105 stars 24 forks source link

Cannot run blockfrost-js as a bundled lambda function - Get the following issue: "errorMessage": "Error: Cannot find module 'util'", #157

Closed borisilic closed 2 years ago

borisilic commented 2 years ago

Hello :wave:

I'm a little pressed for time at the moment to provide a reproducible example but the issue is that bundling this package into a single file using webpack and running it in a lambda environment doesn't work. The issue that I get is that the module util cannot be found. This doesn't really make sense as the util module should be a part of the standard node library anyway.

I believe the issue is similar to this other GH issue from here: https://github.com/apollographql/federation/issues/255

Going through the compiled file I find the same (String.raw`util`); line present.

When I get a bit more time I will try and make an example but just wanted to raise it in the meantime. It's a shame because otherwise the library is great.

vladimirvolek commented 2 years ago

Hello!

I just updated our demo to use SDK with Vercel functions.

You can check it here: https://github.com/blockfrost/blockfrost-demo-asset-explorer

vladimirvolek commented 2 years ago

@borisilic Feel free to reopen if this issue is still valid for you 👅