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

frontend:dev:watcher should be executed after frontend:install. #1182

Closed
misitebao opened this issue Feb 23, 2022 · 9 comments
Closed

frontend:dev:watcher should be executed after frontend:install. #1182

misitebao opened this issue Feb 23, 2022 · 9 comments
Labels
Bug Something isn't working
Milestone

Comments

@misitebao
Copy link
Contributor

misitebao commented Feb 23, 2022

Description
After creating the project, run wails dev for the first time. When frontend:install has not been executed, frontend:dev:watcher will also be executed, and the system prompts lack of dependencies.

To Reproduce
Steps to reproduce the behaviour:

  1. Generate wails cli with master branch
  2. Run wails init -n wails-vue -t https://github.com/misitebao/wails-template-vue
  3. Add "frontend:dev:watcher": "npm run build:watch -w js", to wails.json file
  4. Run wails dev
  5. See error

Expected behaviour
Both synchronous and asynchronous scripts should be executed after the frontend:install command. Otherwise there will be missing dependencies.

Screenshots
image

System Details

$ wails doctor
Wails CLI v2.0.0-beta.32

Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             Windows 10 Pro
Version:        2009 (Build: 19044)
ID:             21H2
Go Version:     go1.17.6
Platform:       windows
Architecture:   amd64

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
WebView2        N/A             Installed       98.0.1108.56
npm             N/A             Installed       8.5.1
*upx            N/A             Available

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/

If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context
None

@misitebao misitebao added the Bug Something isn't working label Feb 23, 2022
@misitebao
Copy link
Contributor Author

misitebao commented Feb 23, 2022

@stffabi @leaanthony
The previous test used an existing project, and the dependencies have been installed, so this problem was not found. I just created a new project and found this problem during the test.

@stffabi
Copy link
Collaborator

stffabi commented Mar 4, 2022

I would be fine calling an install before starting the frontend watcher. To be honest I have no expertise with these integrations, as we currently use another approach for integrating the frontend into wails. If @leaanthony is fine calling an install there I could provide a PR for this.

@leaanthony
Copy link
Member

I just feel that if you're spinning out a watcher, then that should probably handle everything involved in watching. Is that how they work? I intend to move the svelte template to vite so I'll get a bit more insight into this. Thanks @stffabi for offering to do the install. I really want to understand the use cases here for external watcher and proxying to Dev servers like vite. Everyone wants this!

@stffabi
Copy link
Collaborator

stffabi commented Mar 4, 2022

Yeah, absolutely. Unfortunately I really have no expertise and I don't have any usecase for this. So I'm not really a help...

@stffabi
Copy link
Collaborator

stffabi commented Mar 4, 2022

I just feel that if you're spinning out a watcher, then that should probably handle everything involved in watching. Is that how they work?

I had the same feeling.

@misitebao
Copy link
Contributor Author

misitebao commented Mar 4, 2022

@leaanthony
I will take the time to refactor the default svelte template using vite.


PR=> #1214

@leaanthony
Copy link
Member

Amazing! Thanks @misitebao

@misitebao
Copy link
Contributor Author

@stffabi @leaanthony
This issue may need to be discussed, because frontend:dev:watcher and wails dev are asynchronous, but both need to execute the fontend:install command, the former needs to be executed after the fontend:install command is completed. To enable watcher. Not to mention the latter, front-end resource builds must execute frontend:install before proceeding to subsequent steps. We may need to make some adjustments to the timing of frontend:install to make it a prerequisite for frontend:dev:watcher and wails dev.

@leaanthony
Copy link
Member

Fixed by #1216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants