Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xxnuo opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@xxnuo
Copy link

xxnuo commented Dec 19, 2024

版本信息

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

@xxnuo xxnuo added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant