GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.38k stars 84 forks source link

Glitch demo broken #103

Closed tmcw closed 2 years ago

tmcw commented 2 years ago
CleanShot 2022-04-14 at 12 31 30@2x

Was attempting to debug problems in Firefox, and unfortunately the demo is now broken in Firefox.

The demo is broken across all browsers.

tmcw commented 2 years ago

I'm trying to get anything working in Firefox, and it really seems like the legacy method is broken there too https://codesandbox.io/s/infallible-shadow-6p01z2?file=/src/index.js

tomayac commented 2 years ago

You should import the module. The CJS is meant for bundlers.

tomayac commented 2 years ago

It looks like it tried to import the .cjs. For now fixed via passing it the full URL to the .mjs: https://unpkg.com/browser-fs-access@0.27.0/dist/index.mjs.

tomayac commented 2 years ago

Fixed properly by re-introducing the "browser" field in package.json. Please update to v0.28.0.

tmcw commented 2 years ago

Is my Firefox install an outlier for not being able to download files from the Glitch demo? It's not working on Chrome, but broken in Firefox.

tomayac commented 2 years ago

When you now open in the browser or import in JavaScript from the URL https://unpkg.com/browser-fs-access, you’re properly redirected to https://unpkg.com/browser-fs-access@0.28.0/dist/index.mjs by the unpkg CDN, which wasn’t the case before.