Spaces:
Runtime error
Runtime error
fix: add transpilePackages for ESM-only markdown deps (#147)
Browse filesAdd react-markdown and remark-gfm to transpilePackages in next.config.js
so Next.js transpiles these ESM-only modules correctly in all environments.
This fixes 'Module not found: Can't resolve remark-gfm' build errors.
Fixes #142
- next.config.js +2 -0
next.config.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
const nextConfig = {
|
| 3 |
output: 'standalone',
|
| 4 |
turbopack: {},
|
|
|
|
|
|
|
| 5 |
|
| 6 |
// Security headers
|
| 7 |
async headers() {
|
|
|
|
| 2 |
const nextConfig = {
|
| 3 |
output: 'standalone',
|
| 4 |
turbopack: {},
|
| 5 |
+
// Transpile ESM-only packages so they resolve correctly in all environments
|
| 6 |
+
transpilePackages: ['react-markdown', 'remark-gfm'],
|
| 7 |
|
| 8 |
// Security headers
|
| 9 |
async headers() {
|