Skip to content

Commit 7aa397c

Browse files
fix: resolve Next.js 15 ESM export issue with chessground
Replace deprecated transpile module and add chessground to transpilePackages Co-authored-by: Kevin Thomas <46242684+kevinjosethomas@users.noreply.github.com>
1 parent 62e1026 commit 7aa397c

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

next.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
/** @type {import('next').NextConfig} */
22

3-
// eslint-disable-next-line @typescript-eslint/no-var-requires
4-
const withTM = require('next-transpile-modules')(['@react-chess/chessground'])
5-
6-
module.exports = withTM({
3+
module.exports = {
74
reactStrictMode: false,
85
output: 'standalone',
6+
transpilePackages: ['@react-chess/chessground', 'chessground'],
97
async rewrites() {
108
return [
119
{
@@ -44,4 +42,4 @@ module.exports = withTM({
4442
]
4543
},
4644
skipTrailingSlashRedirect: true,
47-
})
45+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"gray-matter": "^4.0.3",
2323
"lila-stockfish-web": "^0.0.7",
2424
"next": "^15.2.6",
25-
"next-transpile-modules": "^10.0.1",
25+
2626
"onnxruntime-web": "^1.23.0",
2727
"posthog-js": "^1.257.0",
2828
"posthog-node": "^5.3.1",

pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)