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

Cant launch jaspr serve or build #372

Open
FabienZE opened this issue Feb 2, 2025 · 9 comments
Open

Cant launch jaspr serve or build #372

FabienZE opened this issue Feb 2, 2025 · 9 comments

Comments

@FabienZE
Copy link

FabienZE commented Feb 2, 2025

Description

With a fresh install of Flutter 3.27.3 stable and a fresh activation of Jaspr on a fresh Ubuntu 24.10 virtual machine, and similarly with my current install of flutter inside VSCode on my linux desktop, the step "[BUILDER] Connecting to the build daemon..." takes a very long time to execute, about 2 minutes.

I can't figure out...

In the output below you can see :
f�vr. 02 16:55:37 [BUILDER] Connecting to the build daemon...
f�vr. 02 16:57:40 [BUILDER] Generating build script...

2 minutes!

Additional Context

jaspr doctor output :

[✓] Jaspr CLI (Version 0.17.0)
  • Dart Version 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "linux_x64" at /home/fabien/Développement/flutter/bin/cache/dart-sdk/bin/dart
  • Running on linux Linux 6.11.0-14-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 10 23:48:25 UTC 2025 - Locale fr_FR.UTF-8
  • Analytics: Enabled

[✓] Current Project
  • Dependencies on core packages:
    • jaspr: ^0.17.0
    • jaspr_builder: ^0.17.0 (dev)
    • jaspr_web_compilers: ^4.1.0 (dev)
    • jaspr_router: ^0.6.1
  • Rendering mode: server
  • Uses jaspr compilers: true
  • Uses flutter embedding: false

jaspr serve --verbose output :

jaspr serve --verbose | ts
f�vr. 02 16:55:37 [CLI] Running jaspr in server rendering mode.
f�vr. 02 16:55:37 [CLI] Starting web compiler...
f�vr. 02 16:55:37 [BUILDER] Connecting to the build daemon...
f�vr. 02 16:57:40 [BUILDER] Generating build script...
f�vr. 02 16:57:40 [BUILDER] Generating build script completed, took 321ms
f�vr. 02 16:57:40 [BUILDER] Starting daemon...
f�vr. 02 16:57:41 [BUILDER] Initializing inputs
f�vr. 02 16:57:41 [BUILDER] Reading cached asset graph...
f�vr. 02 16:57:41 [BUILDER] Reading cached asset graph completed, took 247ms
f�vr. 02 16:57:41 [BUILDER] Checking for updates since last build...
f�vr. 02 16:57:42 [BUILDER] Checking for updates since last build completed, took 791ms
f�vr. 02 16:57:42 [BUILDER] Initializing inputs
f�vr. 02 16:57:42 [BUILDER] Reading cached asset graph...
f�vr. 02 16:57:42 [BUILDER] Reading cached asset graph completed, took 247ms
f�vr. 02 16:57:42 [BUILDER] Checking for updates since last build...
f�vr. 02 16:57:42 [BUILDER] Checking for updates since last build completed, took 791ms
f�vr. 02 16:57:42 [BUILDER] Setting up file watchers...
f�vr. 02 16:57:42 [BUILDER] Setting up file watchers completed, took 2ms
f�vr. 02 16:57:42 [BUILDER] Registering build targets...
f�vr. 02 16:57:42 [BUILDER] Starting initial build...
f�vr. 02 16:57:42 [BUILDER] Starting resource servers...
f�vr. 02 16:57:42 [BUILDER] About to build [web]...
f�vr. 02 16:57:42 [CLI] Building web assets...
f�vr. 02 16:57:42 [BUILDER] Running build...
f�vr. 02 16:57:43 [BUILDER] Running build completed, took 210ms
f�vr. 02 16:57:43 [BUILDER] Caching finalized dependency graph...
f�vr. 02 16:57:43 [BUILDER] Caching finalized dependency graph completed, took 211ms
f�vr. 02 16:57:43 [BUILDER] Succeeded after 443ms with 0 outputs (0 actions)
f�vr. 02 16:57:43 [BUILDER] ------------------------------------------------------------------------
f�vr. 02 16:57:43 [CLI] Done building web assets.
f�vr. 02 16:57:43 [CLI] Starting server...
f�vr. 02 16:57:43 [CLI] Server started.
@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

By dint of perseverance, I finally found a combination that works all the time:

dev_dependencies:
 build_runner: ^2.4.0
 jaspr_web_compilers: ^4.1.0
 # build_web_compilers: ^4.1.0
 jaspr_builder: ^0.17.0

and with build.yaml:

targets:
 $default:
 builders:
 jaspr_web_compilers:entrypoint:
 generate_for:
          -  web/**.dart
 - lib/src/components/**.dart
 dev_options:
 compilers:
 dartdevc:
 release_options:
 compilers:
 # All compilers listed here are enabled:
 dart2js:
 # List any dart2js specific args here, or omit it.
              args:
 - O2
 dart2wasm:
 args:
 - O3

Launching the jaspr serve --verbose command works, but I still have 2 problems that I can't solve and that prevent me from using jaspr, as the process is definitely too long for debugging.
Connecting to the build daemon always takes 2 minutes (far too long!) and building the web assets for each code modification takes about fifteen minutes, which is an absolute pain.
I don't think it's related to jaspr, but I'd like to know where this problem comes from, as I think it could be a point for documentation!

Here my full log of jaspr serve --verbose

jaspr serve --verbose 
[CLI] Running jaspr in server rendering mode.
[CLI] Starting web compiler...
[BUILDER] Connecting to the build daemon...
[BUILDER] Generating build script...
[BUILDER] Generating build script completed, took 310ms
[BUILDER] Starting daemon...
[BUILDER] [WARNing] Overriding configuration for `jaspr_web_compilers:ddc` but this is not a known Builder
[BUILDER] [WARNing] Overriding configuration for `jaspr_web_compilers:entrypoint` but this is not a known Builder
[BUILDER] [WARNing] Configuring `jaspr_web_compilers:entrypoint` in target `xxxx_frontend:xxxx_frontend` but this is not a known Builder
[BUILDER] Initializing inputs
[BUILDER] Reading cached asset graph...
[BUILDER] [WARNing] Throwing away cached asset graph because the build phases have changed. This most commonly would happen as a result of adding a new dependency or updating your dependencies.
[BUILDER] [WARNing] Throwing away cached asset graph because the language version of some package(s) changed. This would most commonly happen when updating dependencies or changing your min sdk constraint.
[BUILDER] Cleaning up outputs from previous builds....
[BUILDER] Cleaning up outputs from previous builds. completed, took 42ms
[BUILDER] Generating build script...
[BUILDER] Generating build script completed, took 80ms
[BUILDER] Invalidated precompiled build script due to missing asset graph.
[BUILDER] Precompiling build script......
[BUILDER] Precompiling build script... completed, took 6.2s
[BUILDER] Starting daemon...
[BUILDER] Initializing inputs
[BUILDER] Building new asset graph...
[BUILDER] Building new asset graph completed, took 3.0s
[BUILDER] Checking for unexpected pre-existing outputs....
[BUILDER] Deleting 12 declared outputs which already existed on disk.
[BUILDER] Checking for unexpected pre-existing outputs. completed, took 0ms
[BUILDER] Initializing inputs
[BUILDER] Building new asset graph...
[BUILDER] Building new asset graph completed, took 3.0s
[BUILDER] Checking for unexpected pre-existing outputs....
[BUILDER] Deleting 12 declared outputs which already existed on disk.
[BUILDER] Checking for unexpected pre-existing outputs. completed, took 0ms
[BUILDER] Setting up file watchers...
[BUILDER] Setting up file watchers completed, took 4ms
[BUILDER] Registering build targets...
[BUILDER] Starting initial build...
[BUILDER] Starting resource servers...
[BUILDER] About to build [web]...
[BUILDER] Running build...
[CLI] Building web assets...
[BUILDER] 1.1s elapsed, 5807/5807 actions completed.
[BUILDER] 2.1s elapsed, 6300/6301 actions completed.
[BUILDER] 3.2s elapsed, 6671/6681 actions completed.
ca[BUILDER] 9.2s elapsed, 6779/6780 actions completed.
[BUILDER] 10.7s elapsed, 6802/6803 actions completed.
[BUILDER] 11.7s elapsed, 7718/7736 actions completed.
[BUILDER] 14.9s elapsed, 7722/7738 actions completed.
[BUILDER] found shelf_router.Route annotations in ApiController
[BUILDER] found shelf_router.Route annotations in SecuredApiController
[BUILDER] found shelf_router.Route annotations in Routes
[BUILDER] found shelf_router.Route annotations in AppController
[BUILDER] 16.2s elapsed, 8629/8637 actions completed.
[CLI] Building web assets... (This takes longer for the initial build)
[BUILDER] 5m 56s elapsed, 9613/9643 actions completed.
[BUILDER] [WARNing] No actions completed for 5m 39s, waiting on:
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta_meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta_meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:web/src/dom.ddc.module
[BUILDER] [WARNing] .. and 25 more
[BUILDER] 9m 43s elapsed, 9613/9643 actions completed.
[BUILDER] [WARNing] No actions completed for 3m 46s, waiting on:
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta_meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta_meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:meta/meta.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:web/src/dom.ddc.module
[BUILDER] [WARNing] .. and 25 more
[BUILDER] 9m 44s elapsed, 9619/9643 actions completed.
[BUILDER] 9m 45s elapsed, 9625/9643 actions completed.
[BUILDER] 11m 39s elapsed, 9628/9643 actions completed.
[BUILDER] [WARNing] No actions completed for 1m 53s, waiting on:
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:jaspr/browser.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on web/src/components/app.client.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on lib/src/components/app.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on web/src/components/hello.client.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on web/main.clients.ddc.module
[BUILDER] [WARNing] .. and 10 more
[BUILDER] 15m 25s elapsed, 9631/9643 actions completed.
[BUILDER] [WARNing] No actions completed for 3m 46s, waiting on:
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on package:jaspr/browser.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on web/main.clients.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on web/src/components/app.client.bootstrap.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on lib/src/components/app.ddc.module
[BUILDER] [WARNing] - jaspr_web_compilers:ddc on web/src/components/app.client.ddc.module
[BUILDER] [WARNing] .. and 7 more
[BUILDER] Running build completed, took 15m 26s
[BUILDER] Caching finalized dependency graph...
[BUILDER] Caching finalized dependency graph completed, took 345ms
[BUILDER] Succeeded after 15m 27s with 1843 outputs (15090 actions)
[BUILDER] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[CLI] Done building web assets.
[CLI] Starting server...
[CLI] Server started.

@schultek
Copy link
Owner

schultek commented Feb 3, 2025

Did you have problems with build_runner before, without using jaspr?

Also can you try setting up a pure dart web app (as here: https://dart.dev/web/get-started) to figure out if its a jaspr or general web thing.

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

Hi @schultek : never have problems with build_runner before, I use it for json_serializable, riverpod, etc

I will try to start a pure dart webapp and show there the results

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

Re:

Here are the result, the quickstart project from dart is much faster than with jaspr ... I can't figure out why

fabien@kcentral:~/dev/temp$ dart create -t web quickstart
Creating quickstart using template web...

  .gitignore
  analysis_options.yaml
  CHANGELOG.md
  pubspec.yaml
  README.md
  web/index.html
  web/main.dart
  web/styles.css

Running pub get...                     1.6s
  Resolving dependencies...
  Downloading packages...
  Changed 66 dependencies!
  2 packages have newer versions incompatible with dependency constraints.
  Try `dart pub outdated` for more information.

Created project quickstart in quickstart! In order to get started, run the following commands:

  cd quickstart
  dart pub global activate webdev
  webdev serve

fabien@kcentral:~/dev/temp$ cd quickstart/
fabien@kcentral:~/dev/temp/quickstart$ dart pub global activate webdev
Package webdev is currently active at version 3.7.0.
Downloading packages... . 
The package webdev is already activated at newest available version.
To recompile executables, first run `dart pub global deactivate webdev`.
Installed executable webdev.
Activated webdev 3.7.0.

Build result:

fabien@kcentral:~/dev/temp/quickstart$ webdev serve --verbose | ts
f�vr. 03 14:27:07 [INFO] Connecting to the build daemon...
f�vr. 03 14:27:08 [INFO] Generating build script...
f�vr. 03 14:27:08 [INFO] Generating build script completed, took 284ms
f�vr. 03 14:27:08 [INFO] 
f�vr. 03 14:27:08 [INFO] Precompiling build script......
f�vr. 03 14:27:12 [INFO] Precompiling build script... completed, took 3.7s
f�vr. 03 14:27:12 [INFO] 
f�vr. 03 14:27:12 [INFO] Starting daemon...
f�vr. 03 14:27:12 [INFO] BuildDefinition: Initializing inputs
f�vr. 03 14:27:12 [INFO] BuildDefinition: Building new asset graph...
f�vr. 03 14:27:13 [INFO] BuildDefinition: Building new asset graph completed, took 968ms
f�vr. 03 14:27:13 
f�vr. 03 14:27:13 [INFO] BuildDefinition: Checking for unexpected pre-existing outputs....
f�vr. 03 14:27:13 [INFO] BuildDefinition: Checking for unexpected pre-existing outputs. completed, took 0ms
f�vr. 03 14:27:13 
f�vr. 03 14:27:13 [SEVERE] Initializing inputs
f�vr. 03 14:27:13 [SEVERE] Building new asset graph...
f�vr. 03 14:27:13 [SEVERE] Building new asset graph completed, took 968ms
f�vr. 03 14:27:13 [SEVERE] 
f�vr. 03 14:27:13 [SEVERE] Checking for unexpected pre-existing outputs....
f�vr. 03 14:27:13 [SEVERE] Checking for unexpected pre-existing outputs. completed, took 0ms
f�vr. 03 14:27:13 [SEVERE] 
f�vr. 03 14:27:13 [SEVERE] Setting up file watchers...
f�vr. 03 14:27:13 [SEVERE] Setting up file watchers completed, took 2ms
f�vr. 03 14:27:13 [SEVERE] 
f�vr. 03 14:27:13 [INFO] Registering build targets...
f�vr. 03 14:27:13 [INFO] Starting initial build...
f�vr. 03 14:27:13 [INFO] Starting resource servers...
f�vr. 03 14:27:13 [INFO] Serving `web` on http://127.0.0.1:8080
f�vr. 03 14:27:13 
f�vr. 03 14:27:13 [INFO] About to build [web]...
f�vr. 03 14:27:13 [INFO] Build: Running build...
f�vr. 03 14:27:14 [INFO] Heartbeat: 1.0s elapsed, 0/2 actions completed.
f�vr. 03 14:27:16 [INFO] Heartbeat: 2.1s elapsed, 0/2 actions completed.
f�vr. 03 14:27:17 [INFO] Heartbeat: 3.2s elapsed, 140/146 actions completed.
f�vr. 03 14:27:18 [INFO] Heartbeat: 4.3s elapsed, 140/146 actions completed.
f�vr. 03 14:27:19 [INFO] Heartbeat: 5.3s elapsed, 146/146 actions completed.
f�vr. 03 14:27:19 [INFO] Build: Running build completed, took 5.4s
f�vr. 03 14:27:19 
f�vr. 03 14:27:19 [INFO] Build: Caching finalized dependency graph...
f�vr. 03 14:27:19 [INFO] Build: Caching finalized dependency graph completed, took 137ms
f�vr. 03 14:27:19 
f�vr. 03 14:27:19 [INFO] Build: Succeeded after 5.6s with 159 outputs (2093 actions)
f�vr. 03 14:27:19 
f�vr. 03 14:27:19 [INFO] ------------------------------------------------------------------------
f�vr. 03 14:27:19 

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

Directly running jaspr after, connecting to daemon took 2 minutes again...
and then build was pretty quick.

jaspr serve --verbose | ts
f�vr. 03 14:29:16 [CLI] Running jaspr in server rendering mode.
f�vr. 03 14:29:16 [CLI] Starting web compiler...
f�vr. 03 14:29:16 [BUILDER] Connecting to the build daemon...
f�vr. 03 14:31:10 [BUILDER] Generating build script...
f�vr. 03 14:31:10 [BUILDER] Generating build script completed, took 310ms
f�vr. 03 14:31:11 [BUILDER] Starting daemon...
f�vr. 03 14:31:11 [BUILDER] Initializing inputs
f�vr. 03 14:31:11 [BUILDER] Reading cached asset graph...
f�vr. 03 14:31:12 [BUILDER] Reading cached asset graph completed, took 401ms
f�vr. 03 14:31:12 [BUILDER] Checking for updates since last build...
f�vr. 03 14:31:13 [BUILDER] Checking for updates since last build completed, took 912ms
f�vr. 03 14:31:13 [BUILDER] Initializing inputs
f�vr. 03 14:31:13 [BUILDER] Reading cached asset graph...
f�vr. 03 14:31:13 [BUILDER] Reading cached asset graph completed, took 401ms
f�vr. 03 14:31:13 [BUILDER] Checking for updates since last build...
f�vr. 03 14:31:13 [BUILDER] Checking for updates since last build completed, took 912ms
f�vr. 03 14:31:13 [BUILDER] Setting up file watchers...
f�vr. 03 14:31:13 [BUILDER] Setting up file watchers completed, took 2ms
f�vr. 03 14:31:13 [BUILDER] Registering build targets...
f�vr. 03 14:31:13 [BUILDER] Starting initial build...
f�vr. 03 14:31:13 [BUILDER] Starting resource servers...
f�vr. 03 14:31:13 [BUILDER] About to build [web]...
f�vr. 03 14:31:13 [CLI] Building web assets...
f�vr. 03 14:31:13 [BUILDER] Running build...
f�vr. 03 14:31:14 [BUILDER] Running build completed, took 250ms
f�vr. 03 14:31:14 [BUILDER] Caching finalized dependency graph...
f�vr. 03 14:31:14 [BUILDER] Caching finalized dependency graph completed, took 332ms
f�vr. 03 14:31:14 [BUILDER] Succeeded after 625ms with 0 outputs (0 actions)
f�vr. 03 14:31:14 [BUILDER] ------------------------------------------------------------------------
f�vr. 03 14:31:14 [CLI] Done building web assets.
f�vr. 03 14:31:14 [CLI] Starting server...
f�vr. 03 14:31:14 [CLI] Server started.
f�vr. 03 14:33:07 [SERVER] [INFO] Server hot reload is enabled.
f�vr. 03 14:33:07 [SERVER] The Dart VM service is listening on http://127.0.0.1:8181/MIKRejQKZ3E=/
f�vr. 03 14:33:07 [SERVER] The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/MIKRejQKZ3E=/devtools/?uri=ws://127.0.0.1:8181/MIKRejQKZ3E=/ws
f�vr. 03 14:33:07 [SERVER] Server running at 0.0.0.0:8080

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

I see that, for the dart quickstart web example,
when I launch webdev serve, there is no DartWorker process and everything works quick.

But when I launch jaspr server, it pops 2 DartWorker process, and the first popped use 1 cpu
his command line is :

dart /home/fabien/.pub-cache/global_package/jaspr_cli/bin/jaspr.dart-3.6.1.snapshot server --verbose

and I think this is this process that take so much time to work

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

On Windows, fresh install, no problem. It works fine.
So, I guess there is a problem under linux.

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

On Fedora 41, fresh install, no problem. It works fine.
So... let me guess it has to deal with Ubuntu, nor Kubuntu, 6.11.0-14 kernel
On Fedora, I am under Linux 6.11.4-301 kernel. So it is not related to the linux kernel.

@FabienZE
Copy link
Author

FabienZE commented Feb 3, 2025

Finally, on Kubuntu 24.04... it works fine!
So problem is Kubuntu 24.10 👎

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