问题1: 页面无法打开localhost:
报错提示:
嗯… 无法访问此页面
tauri.localhost 已拒绝连接。
解决:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
}
module.exports = nextConfig
问题2:tauri在build模式开启右键检查debug功能,找了一上午,结果只是一条命令的事...
其实要想增加这个功能,只需要在src-tauri\Cargo.toml中添加devtools即可:
tauri = { version = "1.0.0-rc.8", features = ["api-all", "devtools"] }
问题3:http可以访问,默认https报错,
报错语句是: Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ''. This request has been blocked; the content must be served over HTTPS.
errAxiosError: Network Error
解决
我改变了tauri.conf.json > tauri > security > dangerousUseHttpScheme = true
,然后它工作了
## 参考
[如何让 tauri 使用 http://tauri.localhost/ 而不是 https://tauri.localhost/ ?由于该页面是通过 HTTPS 加载的,因此已被阻止。· 问题 #3007 · tauri-apps/tauri](https://github.com/tauri-apps/tauri/issues/3007)
[tauri在build模式开启右键检查debug功能,找了一上午,结果只是一条命令的事..._tauri build后打开调试-CSDN博客](https://blog.csdn.net/weixin_44786530/article/details/130151656)