Skip to content

Commit 4728536

Browse files
committed
fix: hardcode basePath, config monaco CDN, disable auto-config
1 parent 784eb51 commit 4728536

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,7 @@ jobs:
5555
cache: ${{ steps.detect-package-manager.outputs.manager }}
5656
- name: Setup Pages
5757
uses: actions/configure-pages@v5
58-
with:
59-
# Automatically inject basePath in your Next.js configuration file and disable
60-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
61-
#
62-
# You may remove this line if you want to manage the configuration yourself.
63-
static_site_generator: next
58+
6459
- name: Restore cache
6560
uses: actions/cache@v4
6661
with:

next.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import type { NextConfig } from "next";
22

3-
const isProd = process.env.NODE_ENV === 'production';
4-
53
const nextConfig: NextConfig = {
64
/* config options here */
75
output: "export",
8-
basePath: isProd ? "/traeweb1" : "",
6+
// Ensure basePath matches the repository name
7+
basePath: "/traeweb1",
8+
// Optional: assetPrefix usually defaults to basePath, but setting it explicitly can help
9+
assetPrefix: "/traeweb1/",
910
images: {
1011
unoptimized: true,
1112
},

public/.nojekyll

6 Bytes
Binary file not shown.

src/components/editor.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
"use client";
22

33
import React, { useRef, useEffect } from "react";
4-
import Editor, { useMonaco } from "@monaco-editor/react";
4+
import Editor, { useMonaco, loader } from "@monaco-editor/react";
55
import { useTheme } from "next-themes";
66
import { Loader2 } from "lucide-react";
77

8+
// Configure Monaco to use a reliable CDN (unpkg) to avoid issues in some regions
9+
loader.config({
10+
paths: {
11+
vs: "https://unpkg.com/monaco-editor@0.44.0/min/vs",
12+
},
13+
});
14+
815
interface EditorProps {
916
value: string;
1017
onChange: (value: string) => void;

0 commit comments

Comments
 (0)