FortAwesome / vue-fontawesome

Font Awesome Vue component
https://fontawesome.com
MIT License
2.39k stars 133 forks source link

Dynamic module loading breaking #209

Open jrgleason opened 4 years ago

jrgleason commented 4 years ago

Bug I am not using babel or any compiler I am just loading directly from the browser. This works for most font awesome stuff such as

import { library } from '/font-awesome/fontawesome-svg-core/index.es.js'
import { faUserSecret } from '/font-awesome/free-solid-svg-icons/index.es.js'
library.add(faUserSecret)

Reproducible test case However, when I add...

import { FontAwesomeIcon } from '/font-awesome/vue-fontawesome/index.es.js'
Vue.component('font-awesome-icon', FontAwesomeIcon)

I get

Uncaught TypeError: Failed to resolve module specifier "@fortawesome/fontawesome-svg-core". Relative references must start with either "/", "./", or "../".

It appears to be related to

import { parse, icon, config, text } from '@fortawesome/fontawesome-svg-core';

Maybe these should be global instead?

Expected behavior I should register the component.

Desktop (please complete the following information):

robmadole commented 4 years ago

@jrgleason the vue-fontawesome packages is not yet compatible with Browser ES modules.

benc-uk commented 4 years ago

I just tried the same, creating a Vue app without webpack/Node, using ES modules and CDN I can't find any way to use Fontawesome :(