Closed haexhub closed 3 years ago
Thanks for the report. Just released v0.19.2
that fixes this.
Wow. What an amazing response time! :1st_place_medal: Thank you very much! Could you please explain me the problem a bit bit more? Why is the optional chaining not working here?
Probably in your webpack config you target browsers that don't match the compatibility of the feature.
Hi,
I'm using browser-fs-access with nuxt and got an error about unexpected tokens in legacy/file-open.mjs and legacy-directory-open.mjs.
export default async( e={})=>new Promise(((t,n)=>{const i=document.createElement("input");i.type="file";const s=[...e.mimeTypes?e.mimeTypes:[],e.extensions?e.extensions:[]].join();let c;i.multiple=e.multiple||!1,i.accept=s||"";const l=()=>c(n);e.setupLegacyCleanupAndRejection&&(c=e.setupLegacyCleanupAndRejection(l)), i.addEventListener("change",(()=>{c?.(),t(i.multiple?Array.from(i.files):i.files[0])})),i.click()}));
The problem is the ? Operator
c?.(),t(i.multiple?Array.from(i.files):i.files[0])})),i.click() // doesn't work
c(),t(i.multiple?Array.from(i.files):i.files[0])})),i.click() // works
I'm not sure why webpack is complaining about, because it's valid javascript.