Closed dgrmunch closed 4 years ago
Hmm, something is up.
Try adding this babel config to your project: https://github.com/datproject/sdk/blob/master/babel.config.json
See if that helps make it compile properly. 😁
Actually, that might not be good either...
Try cloning dat-sdk, building a bundle there, and importing that bundle for now.
I'll need to work on making the workflow better there once I have spare cycles. (probably not for a few weeks at least)
Yeap, you are right. The babel.config did not work either :D No rush. Just let me know whenever you have time to check it ;) In those weeks I can just play with the dat-sdk. I had fun with your workshop at the 2020 Dat Conf :)
Gonna close this for now and track the issue in the dat-sdk repo. 😁
Trying to use dat-fetch in client-side JS
This is my
hyper.js
file:Executing dat-fetch
I execute these commands on the shell to install the required dependencies and check that the script works:
And the script properly runs:
Creating Browserify bundle
If I try to create the bundle with:
I get an error:
So I proceed installing the specified "babilify" module:
I get a warning:
npm WARN babelify@10.0.0 requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
so I proceed:I finally get the bundle and include it as a source in an index.html file:
When I open the file in a browser and I check the console, rather than getting the JSON from the hyperdrive I get:
Can somebody reproduce the error and give me some tips about what should be done in order to execute the dat-fetch API as part of a browser-first javascript proyect?