Cweili / svelte-fa

Tiny FontAwesome component for Svelte

Home Page:https://cweili.github.io/svelte-fa/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CommonJS Error

KaspianDev opened this issue · comments

import { faAlignJustify } from "@fortawesome/free-solid-svg-icons";
         ^^^^^^^^^^^^^^
SyntaxError: Named export 'faAlignJustify' not found. The requested module '@fortawesome/free-solid-svg-icons' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@fortawesome/free-solid-svg-icons';
const { faAlignJustify } = pkg;

This is usually related to your build configuration.

Is it possible to provide your webpack or rollup configuration?

Fixed by using
import { faAlignJustify } from "@fortawesome/free-solid-svg-icons/faAlignJustify";