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

web访问admin出现错误:index.3e4347a8.js 返回MIME类型为 “text/plain” #43

Closed
brucewang585 opened this issue Jun 24, 2022 · 1 comment

Comments

@brucewang585
Copy link

详细错误提示:
index.3e4347a8.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

添加代码 gofound/web/admin/admin.go:
import (
"mime"
)

func init() {
mime.AddExtensionType(".html", "text/html")
mime.AddExtensionType(".css", "text/css")
mime.AddExtensionType(".js", "text/javascript")
}

@newpanjing
Copy link
Collaborator

换linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants