# bt_app FAQ ## Why the window cannot be opened First run in the project directory: ```bash ./bt_app.exe run ``` View the application name, running mode, entry file and error message output by the console. If there is neither `app.json` nor `index.html` in the current directory, the initialization boot page will be opened. ## Why entry failed to load Check by mode: - `static`: `entry` must be a relative file within the project, such as `index.html`. - `server`: `entry` must be a `http://` or `https://` address, and `server.bt` must start the corresponding service. - `remote`: `entry` must be an accessible `http://` or `https://` address. The `static` entry cannot write an absolute path and cannot contain `..`. ## Why the icon does not take effect Currently `app.icon` only supports the `.ico` file in the project: ```json { "app": { "icon": "logo.ico" } } ``` If the icon does not exist during development and runtime, it will fall back to the built-in icon. If the icon file does not exist during packaging, it will fail directly. ## Why the taskbar icon and exe icon are inconsistent The running window icon is loaded by the WebView window, and the packaged exe icon is written to Windows PE resources by the build phase. Please confirm: - `app.icon` points to the same `.ico`. - `resources` or automatic resource collection contains this icon. - `bt_app.exe build` has been re-executed. - Windows Explorer may cache old exe icons. You can change the file name or restart Explorer and try again. ## Why the port is occupied `server` mode will execute `server.bt`. If the `net.listen` bound port is occupied by other processes, the service fails to start and a startup error page will be displayed in the window. Processing method: - Modify the `bind` port of `server.bt`. - Synchronous modification of `app.entry`. - Close the process occupying this port. ## What to do if Windows lacks WebView2 `bt_app`’s desktop window relies on WebView2 Runtime. When the window fails to start and prompts a WebView2-related error, install Microsoft Edge WebView2 Runtime and run it again. ## Can remote addresses control local capabilities? The current versions of `remote`, `server` and `static` pages will inject `window.bt` and allow calling `window.bt.call()` and window control capabilities. Therefore, the remote address must be a trusted address, and do not point `app.entry` to uncontrolled third-party pages. ## Whether devtools should be turned on during the development stage It can be turned on during the development stage to allow WebView to open developer tools: ```json { "dev": { "watch": true, "delay": 500, "devtools": true, "console": true } } ``` The developer tools will not pop up automatically when file changes trigger hot reload; developers must open them manually when debugging the page. After is turned on, you can press `F12` or `Ctrl+Shift+I` to open the developer tools, or you can call it on the page: ```js await window.bt.window.open_devtools() ``` During the release phase, `dev.devtools` is usually closed, and `dev.console` is set to `false` as needed. ## Will it exit if the script or configuration is written incorrectly during development? The development directory will not exit directly due to project errors when running. When `app.json` fails to parse, the entry file is missing, `app.main` is missing, a script error occurs, or a runtime exception occurs, the window will display an error page and continue to monitor file changes; it will automatically reload after repair. Entering the error page will not force the debugging console to pop up, and the console will still be processed according to the last valid `dev.console` configuration. ## Which should be used when app.json and index.html exist at the same time? `app.json` will be used first. Only when there is no `app.json` in the root directory and `index.html` exists, the default `app.json` will be automatically generated and run. `