Closed radu-matei closed 2 months ago
Which package is this? @radu-matei
It would help us to identify which parts of the API, we would need to implement.
@radu-matei Was this error caused when importing the library outside the handleRequest
function? if so it is because the process
module is added to the global scope only when the function is called and set up with the values passed from spin. It should work if the library is imported inside the handleRequest
function. I will look into if we can initialize it earlier so that this error does not happen when compiling with wizer.
Edit: Found the fix, will PR in the next couple of days.
This should now be possible with the new SDK and the wasi-ext
package.
FWIW I just ran into this on v2.2.0 when importing https://github.com/cloudevents/sdk-javascript after polyfilling http/https/events with browserify (but also when importing cloudevents in the request handler)
I am trying to use an external package and the build fails with:
Uncaught ReferenceError: 'process' is not defined