Problems with Provider.create function at getting started example

Hi guys, i´m been implementing the getting started example on fuels-ts docs, i’m getting an error and a warning, additionaly the page is not being rendering.

const provider = await Provider.create('https://beta-4.fuel.network/graphql')

Uncaught ReferenceError: process is not defined
at configs.ts:1:33
browser-external:buffer:9 Module “buffer” has been externalized for browser compatibility. Cannot access “buffer.Buffer” in client code. See Troubleshooting | Vite for more details.

Hi there!
Thanks for sharing your issue.

As seen in this issue the “process.env” was removed from vite, so the fuel ts-sdk might not be compatible.

A workaround might be to manually inject the process.env in the vite config as seen here.

Meanwhile, an issue was opened for this.

Please let me know if it works for you!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.