Closed eric-naguras closed 2 years ago
@eric-naguras Apologies for the delay. The error is coming from native node modules required by the jsc8 SDK. While it's possible to polyfill these libraries in a browser environment, we highly recommend against doing so. Running the jsc8 library in a browser environment comes with significant risk as your Macrometa credentials would be visible in your source code.
If you're querying data stored in GDN, I'd recommend the two options:
1. Proxy requests to a backend API and query GDN from the server environment. This will ensure that your Macrometa credentials are secure. 2. Use RestQL to query the data you need – you can find out more about RestQL here in our docs.
@nparsons08 Thanks for the reply. I did go for option 2. Seems like an even better way to do things. I have no problems using RestQL.
Awesome! We are here if you need help in the future @eric-naguras. Happy coding!
@nparsons08 So far, I think Macrometa is a great product and a perfect match for serverless. I'm saving up some questions that I will ask later. Even though the documentation is a bit sparse, I don't have much problems using the database.
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Using jsc8 version 0.16.3 Using Sveltekit version 1.0.0-next.295 Using @sveltejs/adapter-cloudflare-workers version 1.0.0-next.35
Issue Description
No problems running in Sveltekit's dev mode. But doing a build, which is a pre-requisite for a Wrangler publish I get the following errors:
Steps to Reproduce
Create any simple app that uses jsc8.js and run
npm run build
ornpx svelte-kit build
Current Behavior
Build fails with above mentioned erros
Expected Behavior
Building without errors