import #357
Answered
by
sholladay
andreatrygit
asked this question in
Q&A
import
#357
Replies: 1 comment 7 replies
-
<script type="module">
import ky from 'https://cdn.jsdelivr.net/npm/[email protected]/distribution/index.min.js';
const json = await ky('https://jsonplaceholder.typicode.com/todos/1').json();
console.log(json.title);
//=> 'delectus aut autem
</script> |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
andreatrygit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi there!
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/distribution/index.min.js"></script>I'm using ky from within alpinejs.
I am having trouble importing for the browser.
I do plain:
in my head, but then i get that ky is not defined.
if I do import ky from 'ky' i get that import cannot be used outside a module...
Please help!! :):):):)
Beta Was this translation helpful? Give feedback.
All reactions