Skip to content

Commit

Permalink
Merge pull request #114 from vercel/JohnPhamous-patch-1
Browse files Browse the repository at this point in the history
Add docs for using in Next.js Pages Router
  • Loading branch information
JohnPhamous committed Jul 1, 2024
2 parents 3292810 + 24bc929 commit 546ac0a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ export default function MyApp({ Component, pageProps }) {
}
```

If you're using a version of Next.js that's older than 15, then in `next.config.js` or `next.config.mjs` add:

```diff js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
+ transpilePackages: ["geist"],
};

export default nextConfig;
```

This is required to fix errors like:

- `TypeError: next_font_local__WEBPACK_IMPORTED_MODULE_0___default(...) is not a function`
- `SyntaxError: Cannot use import statement outside a module`

#### With Tailwind CSS

`GeistSans` and `GeistMono` can be used through a CSS variable.
Expand Down

0 comments on commit 546ac0a

Please sign in to comment.