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

在umi中体验mako,打包之后白屏了 #1334

Closed
jiajiaxing1 opened this issue Jun 28, 2024 · 9 comments · Fixed by #1398
Closed

在umi中体验mako,打包之后白屏了 #1334

jiajiaxing1 opened this issue Jun 28, 2024 · 9 comments · Fixed by #1398
Assignees
Labels
bug Something isn't working

Comments

@jiajiaxing1
Copy link

使用的是@umijs/max, umi版本v4.2.11,打包之后白屏了,只看到有些css资源异常了。不太清楚如何去排查问题
image
image
image

@stormslowly
Copy link
Member

估计是项目设置了 publicPath,mako 侧还没有兼容这个配置

@jiajiaxing1
Copy link
Author

publicPath

确实配置了publicPath

@stormslowly stormslowly added the bug Something isn't working label Jun 28, 2024
@whyer11
Copy link
Contributor

whyer11 commented Jun 28, 2024

publicPath

确实配置了publicPath

可以提供更多错误的信息吗?比如抛错的js或者css的具体路径等,或者留一个联系方式

@stormslowly
Copy link
Member

@whyer11 复现的时候你可以在一个 umi 项目中配置 publicPath: '/foo/bar/', 那么我们的 dev server 就需要影响 http://localhost:3000/foo/bar/umi.js 这类的相应资源请求相应了。

@stormslowly
Copy link
Member

@jiajiaxing1 你看看这样绕过行不行
publicPath: process.env.NODE_ENV==="production" ? 你的原来的配置值: '/'

@jiajiaxing1
Copy link
Author

process.env.NODE_ENV==="production" ? 你的原来的配置值: '/'

试了下这个 貌似可以了

@jiajiaxing1
Copy link
Author

publicPath

确实配置了publicPath

可以提供更多错误的信息吗?比如抛错的js或者css的具体路径等,或者留一个联系方式

我在微信mako交流1群,搜索enthusiasm,需要更多信息可以联系我

@whyer11 whyer11 linked a pull request Jul 10, 2024 that will close this issue
whyer11 pushed a commit that referenced this issue Jul 10, 2024
whyer11 pushed a commit that referenced this issue Jul 12, 2024
@drizzlesconsin
Copy link

启用 mako: {}

process.env.PUBLIC_PATH 找不到值了

config/config.ts 配了 publicPath: '/'

@whyer11
Copy link
Contributor

whyer11 commented Jul 13, 2024

启用 mako: {}

process.env.PUBLIC_PATH 找不到值了

config/config.ts 配了 publicPath: '/'

先和上面的回复一样操作,生产环境和开发环境不同配置先绕过。在修了。

sorrycc added a commit that referenced this issue Jul 22, 2024
* fix: the development server was unable to correctly consume the "publicPath" configuration (#1334)

* chore: improve

* chore: update

---------

Co-authored-by: huanyu.why <[email protected]>
Co-authored-by: sorrycc <[email protected]>
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

Successfully merging a pull request may close this issue.

4 participants