[GH-ISSUE #200] White screen when visiting the Web UI #130

Closed
opened 2026-03-15 12:46:57 +03:00 by kerem · 4 comments
Owner

Originally created by @nkosi23 on GitHub (Oct 29, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/200

Hello,

I am new to mailpit and have just installed it using go install github.com/axllent/mailpit@latest. While mailpit is apparently successfully launched:

me@localhost:~/go/bin> ./mailpit 
INFO[2023/10/29 11:23:11] [smtpd] starting on 0.0.0.0:1025             
INFO[2023/10/29 11:23:11] [http] starting server on http://localhost:8025/ 

Visiting the web page gives me a blank page and I can see the following messages in dev tools:

Content Security Policy: The page's settings blocked the loading of an inline resource (« script-src »)
 http://localhost:8025/dist/app.css?dev » was blocked due a MIME type (« text/plain ») incorrect (X-Content-Type-Options: nosniff)
 http://localhost:8025/dist/app.js?dev » was blocked due a MIME type (« text/plain ») incorrect (X-Content-Type-Options: nosniff)

I apparently get 404 errors for these two files. The HTML of the page is:

<!DOCTYPE html>
<html lang="en" class="h-100">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0">
	<meta name="referrer" content="no-referrer">
	<meta name="robots" content="noindex, nofollow, noarchive">
	<link rel="icon" href="/favicon.svg">
	<title>Mailpit</title>
	<link rel=stylesheet href="/dist/app.css?dev">
</head>

<body class="h-100">
	<div class="container-fluid h-100 d-flex flex-column" id="app" data-webroot="/">
		<noscript>You require JavaScript to use this app.</noscript>
	</div>

	<script src="/dist/app.js?dev"></script>
</body>

</html>

There is nothing fancy in my setup (no reverse proxy etc...) I am just launching the binary.

Originally created by @nkosi23 on GitHub (Oct 29, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/200 Hello, I am new to mailpit and have just installed it using `go install github.com/axllent/mailpit@latest`. While mailpit is apparently successfully launched: ``` me@localhost:~/go/bin> ./mailpit INFO[2023/10/29 11:23:11] [smtpd] starting on 0.0.0.0:1025 INFO[2023/10/29 11:23:11] [http] starting server on http://localhost:8025/ ``` Visiting the web page gives me a blank page and I can see the following messages in dev tools: ``` Content Security Policy: The page's settings blocked the loading of an inline resource (« script-src ») http://localhost:8025/dist/app.css?dev » was blocked due a MIME type (« text/plain ») incorrect (X-Content-Type-Options: nosniff) http://localhost:8025/dist/app.js?dev » was blocked due a MIME type (« text/plain ») incorrect (X-Content-Type-Options: nosniff) ``` I apparently get 404 errors for these two files. The HTML of the page is: ```html <!DOCTYPE html> <html lang="en" class="h-100"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="referrer" content="no-referrer"> <meta name="robots" content="noindex, nofollow, noarchive"> <link rel="icon" href="/favicon.svg"> <title>Mailpit</title> <link rel=stylesheet href="/dist/app.css?dev"> </head> <body class="h-100"> <div class="container-fluid h-100 d-flex flex-column" id="app" data-webroot="/"> <noscript>You require JavaScript to use this app.</noscript> </div> <script src="/dist/app.js?dev"></script> </body> </html> ``` There is nothing fancy in my setup (no reverse proxy etc...) I am just launching the binary.
kerem closed this issue 2026-03-15 12:47:03 +03:00
Author
Owner

@axllent commented on GitHub (Oct 29, 2023):

Hi there. You cannot install Mailpit in this way because it doesn't come bundled with precompiled CSS & J's files. Please refer to the documentation if you wish to compile it yourself.

<!-- gh-comment-id:1784195747 --> @axllent commented on GitHub (Oct 29, 2023): Hi there. You cannot install Mailpit in this way because it doesn't come bundled with precompiled CSS & J's files. Please refer to [the documentation](https://mailpit.axllent.org/docs/install/source/) if you wish to compile it yourself.
Author
Owner

@nkosi23 commented on GitHub (Oct 29, 2023):

Wow this fixes the issue, thanks a lot!
But I am a bit confused then, since everything is bundled in a single executable file and since taking a look at the source I can see that the file system used by the webserver is a virtual one, why aren't the CSS & JS included when mailpit is installed using go install? Would it be feasible to create a go package containing the pre-built assets so that go install is able to include everything?

Anyway, just to provide some context, I came across mailhog this morning and quickly noticed that people were recommending mailpit as a near drop-in replacement, so I naively assumed that it would support the same install process (which is quite neat in my opinion, but extracting a binary is easy enough to be fair).

Thanks a lot for this tool, mailpit looks like an outstanding tool that will greatly improve what used to be a rudimentary workflow as far as my email-related development tasks were concerned!

<!-- gh-comment-id:1784204578 --> @nkosi23 commented on GitHub (Oct 29, 2023): Wow this fixes the issue, thanks a lot! But I am a bit confused then, since everything is bundled in a single executable file and since taking a look at the source I can see that the file system used by the webserver is a virtual one, why aren't the CSS & JS included when mailpit is installed using `go install`? Would it be feasible to create a go package containing the pre-built assets so that go install is able to include everything? Anyway, just to provide some context, I came across mailhog this morning and quickly noticed that people were recommending mailpit as a near drop-in replacement, so I naively assumed that it would support the same install process (which is quite neat in my opinion, but extracting a binary is easy enough to be fair). Thanks a lot for this tool, mailpit looks like an outstanding tool that will greatly improve what used to be a rudimentary workflow as far as my email-related development tasks were concerned!
Author
Owner

@axllent commented on GitHub (Oct 29, 2023):

@nkosi23 Good questions. The pre-compiled binaries do include everything including the "virtual" filesystem used by the web UI (bundled JS, CSS, images etc), but the source code does not include the compiled assets (just the source files to build these). The reason for this is simple: as I'm sure you can image, the precompiled CSS & JavaScript is quite large (relatively speaking). If the compiled versions were bundled and I was to make a small change to either of those, the entire compiled files would be checked back into git each time (not just the line or character change as they are minified, so everything is on a single line). This would lead to a much bigger source repository filled with tonnes of irrelevant historical data.

Anyway, this is the path I chose, and while that does mean that go install... doesn't work, I have provided multiple ways to install a fully working version, and instructions for those wanting to compile it (all) from source.

I hope that makes sense?

<!-- gh-comment-id:1784243747 --> @axllent commented on GitHub (Oct 29, 2023): @nkosi23 Good questions. The pre-compiled binaries do include everything including the "virtual" filesystem used by the web UI (bundled JS, CSS, images etc), but the source code does not include the compiled assets (just the source files to build these). The reason for this is simple: as I'm sure you can image, the precompiled CSS & JavaScript is quite large (relatively speaking). If the compiled versions were bundled and I was to make a small change to either of those, the entire compiled files would be checked back into git each time (not just the line or character change as they are minified, so everything is on a single line). This would lead to a much bigger source repository filled with tonnes of irrelevant historical data. Anyway, this is the path I chose, and while that does mean that `go install...` doesn't work, I have provided multiple ways to install a fully working version, and instructions for those wanting to compile it (all) from source. I hope that makes sense?
Author
Owner

@nkosi23 commented on GitHub (Oct 29, 2023):

This makes absolute sense, thanks a lot for taking the time to share these insights with me

<!-- gh-comment-id:1784248695 --> @nkosi23 commented on GitHub (Oct 29, 2023): This makes absolute sense, thanks a lot for taking the time to share these insights with me
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#130
No description provided.