Skip to content

Commit 31468f3

Browse files
quanruclaude
andcommitted
fix(shared): set explicit publicPath in MCP packages to prevent Node.js runtime crash
Without an explicit publicPath, rspack injects auto-detection code that relies on browser APIs (document.currentScript). This crashes MCP servers running in Node.js with "Automatic publicPath is not supported in this browser". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9a4c809 commit 31468f3

5 files changed

Lines changed: 15 additions & 0 deletions

File tree

packages/android-mcp/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export default defineConfig({
3333
plugins: [injectReportHtmlFromCore(__dirname)],
3434
tools: {
3535
rspack: {
36+
output: {
37+
publicPath: '/',
38+
},
3639
plugins: [
3740
new rspack.BannerPlugin({
3841
banner: '#!/usr/bin/env node',

packages/computer-mcp/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default defineConfig({
3232
plugins: [injectReportHtmlFromCore(__dirname)],
3333
tools: {
3434
rspack: {
35+
output: {
36+
publicPath: '/',
37+
},
3538
plugins: [
3639
new rspack.BannerPlugin({
3740
banner: '#!/usr/bin/env node',

packages/harmony-mcp/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export default defineConfig({
1818
plugins: [injectReportHtmlFromCore(__dirname)],
1919
tools: {
2020
rspack: {
21+
output: {
22+
publicPath: '/',
23+
},
2124
plugins: [
2225
new rspack.BannerPlugin({
2326
banner: '#!/usr/bin/env node',

packages/ios-mcp/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export default defineConfig({
3131
plugins: [injectReportHtmlFromCore(__dirname)],
3232
tools: {
3333
rspack: {
34+
output: {
35+
publicPath: '/',
36+
},
3437
plugins: [
3538
new rspack.BannerPlugin({
3639
banner: '#!/usr/bin/env node',

packages/web-bridge-mcp/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export default defineConfig({
3131
plugins: [injectReportHtmlFromCore(__dirname)],
3232
tools: {
3333
rspack: {
34+
output: {
35+
publicPath: '/',
36+
},
3437
plugins: [
3538
new rspack.BannerPlugin({
3639
banner: '#!/usr/bin/env node',

0 commit comments

Comments
 (0)