I'm trying to build a simple website using Astro, it runs perfectly fine when using astro dev
but I can't build the website using astro build
because this happens:
The error I'm getting:
error Named export 'faGithub' not found. The requested module '@fortawesome/free-brands-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-brands-svg-icons';
const { faGithub, faLinkedin, faDiscord } = pkg;
Here's my code:
import {
faGithub,
faLinkedin,
faDiscord,
} from "@fortawesome/free-brands-svg-icons";
Here's my tsconfig.json
file:
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"types": ["astro/client"]
}
}