vue3-sfc-loader icon indicating copy to clipboard operation
vue3-sfc-loader copied to clipboard

Uncaught TypeError: Cannot destructure property `loadModule` of 'undefined' or 'null'.

Open 523952880 opened this issue 4 years ago • 0 comments

Android 11 Edge 45.09.4.5079

When I use the edge browser of the android phone, I get the following error

Uncaught TypeError: Cannot destructure property loadModule of 'undefined' or 'null'.

const options = {
    moduleCache: {
        vue: Vue
    },
    async getFile(url) {
        const res = await fetch(url)
        if (!res.ok)
            throw Object.assign(new Error(res.statusText + " " + url), { res })
        return {
            getContentData: (asBinary) =>
                asBinary ? res.arrayBuffer() : res.text()
        }
    },
    addStyle(textContent) {
        const style = Object.assign(document.createElement('style'), {
            textContent
        })
        const ref = document.head.getElementsByTagName('style')[0] || null
        document.head.insertBefore(style, ref)
    }
}

const { loadModule } = window['vue3-sfc-loader']

Describe the bug

To Reproduce

Expected behavior

Versions

  • Browser (name & version):
  • vue3-sfc-loader:

Additional context

523952880 avatar Aug 12 '21 08:08 523952880