kunkunsh / kunkun-nuxt

An open source, cross-platform, extensible app launcher.
https://kunkun.sh
48 stars 8 forks source link

BUG: Extension Template works in browser but fails within KunKun App - "File not found" Error Displayed #79

Open jonasrafa opened 6 days ago

jonasrafa commented 6 days ago

Describe the bug The KunKun extension template functions as expected when tested in a standard web browser; however, it does not work within the KunKun app, where it simply returns a "File not found" error.

To Reproduce Steps to reproduce the behavior:

  1. Run the command npm init kunkun@latest in the terminal.
  2. Choose the "React Custom UI" option during setup.
  3. After initializing, run pnpm install to install dependencies.
  4. Execute pnpm dev to start the extension.
  5. Launch the KunKun app and observe the error "File not found" displayed instead of the expected extension output.

Expected behavior The extension should run as intended within the KunKun app, providing the same functionality observed in the browser environment.

Screenshots

https://github.com/user-attachments/assets/2c45db54-eb85-46ba-b06b-40b7e9de7d46

Desktop (please complete the following information):

KunKun version

HuakunShen commented 6 days ago

Hi, sorry about this. The app is undergoing a big extension loading redesign in v0.1.9, the scaffold package for npm init is outdated. I am going to release a new one.

HuakunShen commented 6 days ago

@jonasrafa There was a bug in v0.1.9-beta.4

Can you update to the latest app https://github.com/kunkunsh/kunkun/releases/tag/Kunkun-v0.1.9-beta.5

And generate extension template again? npm init kunkun@latest

I just experimented with a react extension and a template worker extension, both worked for me.

jonasrafa commented 6 days ago

Template worker I can't test because this error https://github.com/kunkunsh/kunkun/issues/78#issue-2615866523

With react, the error remains the same.

https://github.com/user-attachments/assets/e4f903df-e28e-4363-9aa8-150042ecd7c8

HuakunShen commented 6 days ago

@jonasrafa To test the dev server, you need to turn on the live load mode. image

In production the app ships from a static file, so you have to tell the app where to load from. In the package.json, it's main and devMain

jonasrafa commented 6 days ago

With this option activated, it works perfectly. Thank you

But with “pnpm build” the screen is completely white.

https://github.com/user-attachments/assets/e728de5c-8a05-45ca-89ea-aa7086323f9a

HuakunShen commented 6 days ago

I see. I suspect this is another incompatibility issue with Windows. This app was developed on Mac and I haven't had time to thoroughly test it on Windows yet. I will fix it.

HuakunShen commented 6 days ago

v0.2 is almost ready, I will make an intro video to the app and demo videos to show how to develop extensions.

HuakunShen commented 6 days ago

image Issue found, the index.html is loaded, but the js and css files can't be loaded. However, I could fetch the files with fetch. Very weird, this never happened on Mac.

HuakunShen commented 6 days ago

I raised this issue with Tauri https://github.com/tauri-apps/tauri/issues/11505

This problem is critical to this application.