FranckFreiburger / vue3-sfc-loader

Single File Component loader for Vue2 and Vue3. Load .vue files directly from your HTML. No node.js environment, no build step.
MIT License
1.03k stars 116 forks source link

error on importing a redirected file #79

Closed BananaAcid closed 3 years ago

BananaAcid commented 3 years ago

Describe the bug

I am importing a unpkg.com file, wich gets redirected to the reqal file. Fetch gets it, as in the examples, but die module ... shows an error:

To Reproduce in a the first .vue component, app.vue showing a hello world, and having:

import { hexToRgba } from "//unpkg.com/hex-and-rgba";

results in https://unpkg.com/hex-and-rgba@1.4.2/index.js -- the Chrome Network tab shows the redirected request, dumping right in the getFiles() function shows the content.

and the error:

Uncaught (in promise) ReferenceError: hexToRgba is not defined
    at Object.eval (eval at A (vue3-sfc-loader:75),
    at A (vue3-sfc-loader:75)
    at vue3-sfc-loader:75
    at async vue3-sfc-loader:75
    at async w (vue3-sfc-loader:75)
    at async j (vue3-sfc-loader:75)

Expected behavior I believe, any redirect should work.

Versions