Skip to content

[Bug]: SSG 生成站点后使用其他 web server 启动的服务器访问 http://localhost:8080/__polyfill__ 会无限重载 #6646

@xxnuo

Description

@xxnuo

版本信息

System:
  OS: macOS 14.5
  Shell: 5.9 - /bin/zsh
npmPackages:
  @modern-js/app-tools: 2.63.2 => 2.63.2 
  @modern-js/plugin-polyfill: 2.63.2 => 2.63.2 
  @modern-js/plugin-router-v5: 2.63.2 => 2.63.2 
  @modern-js/plugin-ssg: 2.63.2 => 2.63.2 
  @modern-js/plugin-tailwindcss: 2.63.2 => 2.63.2 
  @modern-js/runtime: 2.63.2 => 2.63.2 
  @modern-js/tsconfig: 2.63.2 => 2.63.2

问题详情

脚手架默认创建的新项目,使用如下配置

import { appTools } from "@modern-js/app-tools";
import { tailwindcssPlugin } from "@modern-js/plugin-tailwindcss";
import { ssgPlugin } from '@modern-js/plugin-ssg';


// https://modernjs.dev/en/configure/app/usage
module.exports = {
	dev: {
		writeToDisk: false,
	},
	output: {
		ssg: true,
	},
	runtime: {
		router: true,
	},
	plugins: [
		appTools({
			bundler: "rspack", // Set to 'webpack' to enable webpack
		}),
		tailwindcssPlugin(),
		ssgPlugin(),
	],
};

未使用 polyfillPlugin,执行 pnpm modern deploy && node .output/index.js 打开 http://localhost:8080/__polyfill__ 页面会陷入无休止的重载,console 提示 The initial URL / and the URL /__polyfill__ to be hydrated do not match, reload.

复现链接

npx @modern-js/create@latest myapp

复现步骤

pnpm modern deploy && node .output/index.js

Metadata

Metadata

Assignees

Labels

💉 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions