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

`n.helpers.keys is not a function or its return value is not iterable` #86

Closed trekze closed 3 years ago

trekze commented 3 years ago

I had to switch from unpkg to jsdelivr a few seconds ago because the latter was failing for all my users. Have you recently pushed an update? if so jsdelivr might start failing soon as well if it's just on the old one. Please have a look into this! Will try to grab a copy of the current working one.

jsDelivr CDN: https://cdn.jsdelivr.net/npm/vue3-sfc-loader/dist/vue3-sfc-loader.js UNPKG CDN: https://unpkg.com/vue3-sfc-loader

Error: n.helpers.keys is not a function or its return value is not iterable

image

FranckFreiburger commented 3 years ago

...meanwhile, use the previous version : https://cdn.jsdelivr.net/npm/vue3-sfc-loader@0.8.0/dist/vue3-sfc-loader.js

FranckFreiburger commented 3 years ago

please give more details about your browser

trekze commented 3 years ago

Fails on all browsers from what I can see. At least chrome, brave and firefox.

FranckFreiburger commented 3 years ago

any minimalist testcase ?

trekze commented 3 years ago

Afraid not. Will have to go back to day-to-day work for now that I can use the old version (thanks for the CDN link). If you're struggling a few days from now, I can try and help out with a test case then.

Keep up the good work.

FranckFreiburger commented 3 years ago

core-js is polluting vue3 global scope

testcase:

<!DOCTYPE html>
<html>
<body>
  <div id="app"></div>
  <script src="https://cdn.jsdelivr.net/npm/vue3-sfc-loader@0.8.1"></script>
  <script src="https://unpkg.com/vue@3.0.11"></script>
  <script>

    [...new Map().keys()]

  </script>
</body>
</html>

throws Uncaught TypeError: Map.keys is not a function or its return value is not iterable

in [...new Map().keys()]

Map is defined by core-js [... is native

JamShady commented 3 years ago

Oh my days, I wish I'd checked here earlier. I've literally spent all day on this thinking it was Vue :(

So, just to add:

FranckFreiburger commented 3 years ago

fixed in https://github.com/FranckFreiburger/vue3-sfc-loader/commit/ca73b8f40321770d3256e565fa5dbc998a5bee5c