-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency issue with fortawesome building svelte-kit #107
Comments
Aha - I fixed it by setting kit.vite.ssr.noExternal to ["@fortawesome/*"] in the svelte.config.cjs |
I've tried to reproduce this issue in a fresh new sveltekit+ts application. When starting the development server, all works. But when creating a build ( Since this is a general issue, more people will hit this issue. it would be neath to try create a workaround for it, like your link describes replacing |
I just verified, and adding |
Fixed now in |
I've just updated everything to the latest SvelteKit and Vite, and now fortawesome is giving issues again event with the
I've reverted this workaround to import the "regular" way again. Then the original issue pops up again:
At least, this original issue can be solved by configuring vite with // file: vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
ssr: {
noExternal: [
"@fortawesome/*"
]
}
};
export default config; If anyone knows an other workaround for this I would love to know. This will probably be fixed via the following FortAwesome PR: FortAwesome/Font-Awesome#19041 |
This is fixed now with the latest version of |
When I include the editor in my svelte-kit typescript project and build the project, I get the following error. It seems like it can't find the fortawesome dependency. Not sure if it helps to add the the typescript definition described here: svelte-fa work work with sveltekitvite
`file:///Users/mcqdevin/Documents/GitHub/bare-svelte/.svelte-kit/output/server/entries/pages/configurations/index.svelte.js:22
import { faExclamationTriangle, faAngleDown, faSortAmountDownAlt, faFilter, faSearch, faUndo, faRedo, faTimes, faCaretDown, faPen, faCut, faCopy, faPaste, faClone, faCropAlt, faCaretSquareUp, faCaretSquareDown, faCaretRight, faEllipsisV, faAngleRight, faCircleNotch, faChevronDown, faChevronUp, faCode, faWrench, faCheck, faCog } from "@fortawesome/free-solid-svg-icons";
^^^^^^^^^^^
SyntaxError: Named export 'faAngleDown' 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 { faExclamationTriangle, faAngleDown, faSortAmountDownAlt, faFilter, faSearch, faUndo, faRedo, faTimes, faCaretDown, faPen, faCut, faCopy, faPaste, faClone, faCropAlt, faCaretSquareUp, faCaretSquareDown, faCaretRight, faEllipsisV, faAngleRight, faCircleNotch, faChevronDown, faChevronUp, faCode, faWrench, faCheck, faCog } = pkg;
`
The text was updated successfully, but these errors were encountered: