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

fix: Jaspr Build Fail On New Project #310

Open
mcmah309 opened this issue Sep 19, 2024 · 6 comments
Open

fix: Jaspr Build Fail On New Project #310

mcmah309 opened this issue Sep 19, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@mcmah309
Copy link
Contributor

mcmah309 commented Sep 19, 2024

Description

Jaspr fails when trying to start a new project in a container. The issue was not observed outside a container.

Output

The below output was run inside a container. Based on the below output, does jaspr build currently fail if there is any stderr output from flutter? Running as root is common in containers and the message from flutter is expected. Other than that, nothing useful from --verbose. This is my usual flutter dev environment I always use.

root@c-nixos:/workspaces/voyver_website (jaspr)$ jaspr create voyver_website
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Select a rendering mode: static: Build a statically pre-rendered site.
(Recommended) Enable automatic hydration on the client? (Y/n) Yes
Setup routing for different pages of your site? (Y/n) Yes
(Recommended) Use multi-page (server-side) routing? Choosing [no] sets up a single-page application with client-side routing instead. (Y/n) Yes
Setup Flutter web embedding? (y/N) No
Enable support for using Flutter web plugins in your project? (Y/n) Yes
✓ Generated 25 file(s) (0.2s)
✗ [CLI] [ERROR] Woah! You appear to be trying to run flutter as root. (5ms)
[CLI] [ERROR] We strongly recommend running the flutter tool without superuser privileges.
[CLI] [ERROR] /
[CLI] [ERROR] 📎
✓ [CLI]  (15.4s)
Created project voyver_website! In order to get started, run the following commands:

cd voyver_website
jaspr serve
root@c-nixos:/workspaces/voyver_website (jaspr)$ cd voyver_website/
root@c-nixos:/workspaces/voyver_website/voyver_website (jaspr)$ jaspr serve
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Running jaspr in static rendering mode.
[BUILDER] [ERROR] Unsupported operation: Calling "flutter doctor" resulted in: "   Woah! You appear to be trying to run flutter as root.
[BUILDER] [ERROR] We strongly recommend running the flutter tool without superuser privileges.
[BUILDER] [ERROR] /
[BUILDER] [ERROR] 📎
[BUILDER] [ERROR] ". Make sure flutter is installed and setup correctly.
Bad state: Unable to start build daemon.
root@c-nixos:/workspaces/voyver_website/voyver_website (jaspr)$ jaspr doctor
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
[✓] Jaspr CLI (Version 0.15.1)
  • Dart Version 3.5.2 (stable) (Wed Aug 28 10:01:20 2024 +0000) on "linux_x64" at /usr/local/flutter/bin/cache/dart-sdk/bin/dart
  • Running on linux Linux 6.9.7 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jun 27 11:52:32 UTC 2024 - Locale en_US.UTF-8
  • Analytics: Enabled

[✓] Current Project
  • Dependencies on core packages:
    • jaspr: ^0.15.1
    • jaspr_builder: ^0.15.1 (dev)
    • jaspr_web_compilers: ^4.0.10 (dev)
    • jaspr_router: ^0.5.1
  • Rendering mode: static
  • Uses jaspr compilers: true
  • Uses flutter embedding: false

root@c-nixos:/workspaces/voyver_website/voyver_website (jaspr)$ jaspr build --verbose
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Building jaspr for static rendering mode.
Building web assets...
[BUILDER] Generating build script...
[BUILDER] Generating build script completed, took 297ms
[BUILDER] Invalidated precompiled build script due to missing asset graph.
[BUILDER] Precompiling build script......
[BUILDER] Precompiling build script... completed, took 642ms
[BUILDER] Starting daemon...
[BUILDER] [ERROR] Unsupported operation: Calling "flutter doctor" resulted in: "   Woah! You appear to be trying to run flutter as root.
[BUILDER] [ERROR] We strongly recommend running the flutter tool without superuser privileges.
[BUILDER] [ERROR] /
[BUILDER] [ERROR] 📎
[BUILDER] [ERROR] ". Make sure flutter is installed and setup correctly.
Bad state: Unable to start build daemon.
@mcmah309 mcmah309 added the bug Something isn't working label Sep 19, 2024
@schultek
Copy link
Owner

This isn't really something jaspr can control I think cause it needs to run flutter for certain things.
The proper solution would be to create a non-root user.

If you don't need flutter plugin support, you can also select 'No' for "Enable support for using Flutter web plugins in your project? (Y/n)", which should workaround that.

@mcmah309
Copy link
Contributor Author

Just to clarify, Flutter runs fine in my container. It's just that warning message is expected. My only thought was, maybe Jaspr is failing because it gets a message on stderr, then that is something Jaspr can fix. If this is not the case, then this is still a bug as I expect Jaspr to work since this environment has everything Jaspr should need.

@schultek
Copy link
Owner

Ah thanks for clarifying. That could be the case.

To make it easier for me to debug, can you run 'dart run build_runnrr build' instead of jaspr build and see of it also fails?

@mcmah309
Copy link
Contributor Author

mcmah309 commented Sep 19, 2024

Sure

root@c-nixos:/workspaces/voyver_website/voyver_website (jaspr)$ dart run build_runner build
Building package executable... (2.4s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 177ms
[WARNING] Invalidated precompiled build script due to core package update
[INFO] Precompiling build script... completed, took 2.4s
[SEVERE] 
Unsupported operation: Calling "flutter doctor" resulted in: "   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
". Make sure flutter is installed and setup correctly.
package:jaspr_web_compilers/src/common.dart 20:5  webSdkDir.<fn>
package:jaspr_web_compilers/src/common.dart 36:3  webSdkDir
package:jaspr_web_compilers/src/common.dart       webSdkDir
package:jaspr_web_compilers/builders.dart 58:20   ddcKernelBuilder
package:build_runner                              BuildCommand._run
package:args/command_runner.dart 212:13           CommandRunner.runCommand
package:build_runner                              run
.dart_tool/build/entrypoint/build.dart 229:16     main

root@c-nixos:/workspaces/voyver_website/voyver_website (jaspr)$ flutter --version
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Flutter 3.24.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4cf269e36d (2 weeks ago) • 2024-09-03 14:30:00 -0700
Engine • revision a6bd3f1de1
Tools • Dart 3.5.2 • DevTools 2.37.2

@mcmah309
Copy link
Contributor Author

mcmah309 commented Sep 19, 2024

This does seem to be the case

https://github.com/schultek/build/blob/5f5e40806899ff71fe611af5d691320240a60206/jaspr_web_compilers/lib/src/common.dart#L19

Checking exit code may be a better idea

@BenAuerDev
Copy link

BenAuerDev commented Oct 3, 2024

I'm also running into this when trying to build/deploy my website

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