xmlbuilder2 icon indicating copy to clipboard operation
xmlbuilder2 copied to clipboard

Doesn't work in Cloudflare Pages: Cannot read properties of undefined (reading 'TYPED_ARRAY_SUPPORT')

Open KTibow opened this issue 2 years ago • 5 comments

Describe the bug When I try to use this library on Cloudflare Pages, I get the error

Cannot read properties of undefined (reading 'TYPED_ARRAY_SUPPORT')

This is relevant to node-libs-browser requiring buffer.

To Reproduce Make a SvelteKit project, and require this library. Import it dynamically (in order to be able to view the error message, since Cloudflare pages doesn't have logs). When importing it, you get an error like

TypeError: Cannot read properties of undefined (reading 'TYPED_ARRAY_SUPPORT')

Expected behavior The library to import and run normally in CF Pages' JS interpreter.

Version:

  • node.js: 17
  • xmlbuilder2 ^3.0.2

Additional context N/A

KTibow avatar Aug 09 '22 18:08 KTibow

I have the exact same problem. Did you find a workaround @KTibow ?

frederichoule avatar Jul 13 '23 20:07 frederichoule

I'm using fast-xml-parser right now (iirc)

KTibow avatar Jul 13 '23 21:07 KTibow

Thanks, just did the same. Works flawlessly.

frederichoule avatar Jul 14 '23 11:07 frederichoule