I tried using a google font from @next/font but I am getting this error, I think this has something to do with the webpack or swc. I am using solito with tailwindcss.
x Font loader calls must be assigned to a const
,-[/config/workspace/website/apps/next/pages/_app.tsx:22:1]
22 | import { jsx as _jsx } from "react/jsx-runtime";
23 | import { jsxs as _jsxs } from "react/jsx-runtime";
24 | import { Fragment as _Fragment } from "react/jsx-runtime";
25 | ,-> var ssp = Source_Sans_Pro({
26 | | subsets: ['latin'],
27 | | weight: '400'
28 | `-> });
29 |
30 | function MyApp(_ref) {
31 | var Component = _ref.Component,
TLDR, the compiler is converting const into vars, which makes nextjs throw it as an error.
I tried using a google font from
@next/font
but I am getting this error, I think this has something to do with the webpack or swc. I am using solito with tailwindcss.TLDR, the compiler is converting const into vars, which makes nextjs throw it as an error.
The actual code looks like this.