gornostay25 / svelte-adapter-bun

A SvelteKit adapter for Bun
MIT License
534 stars 33 forks source link

Polyfills() error when running in production #23

Closed peterlerche closed 1 year ago

peterlerche commented 1 year ago

Using a skeleton bun project following the guideline https://bun.sh/guides/ecosystem/sveltekit and replacing @sveltejs/adapter-auto with svelte-adapter-bun, I get the following error when running.

bun --bun run ./build/index.js 
572 | }, globals = {
573 |   File
574 | };
575 | function installPolyfills() {
576 |   for (let name in globals)
577 |     Object.defineProperty(globalThis, name, {
        ^
TypeError: Attempting to change configurable attribute of unconfigurable property.
      at installPolyfills (/home/peterl/Code/my-app/build/index.js:577:4)
      at /home/peterl/Code/my-app/build/index.js:587:0

Executing dev, build, and preview work flawlessly.

Is the polyfill for the File class legacy code?

gornostay25 commented 1 year ago

Thanks for your issue. Yeah, now Bun support File it will be fixed in new version of adapter Thanks @kolchurinvv https://github.com/gornostay25/svelte-adapter-bun/pull/22