Skip to content

fail during "serverpod create", when or after flutter web builld #4466

Closed

Description

@Metaildust

Describe the bug

i ran "serverpod create", failed when building flutter web. it doesn't effects me since i'm doing it only for migrate project to 3.0 with out step-by-step, but this might be helpful. And i think i should notice that i'm located in China, this might be triggerd because of the internet fire wall or pub mirror settings.

logs:

⠏ Building Flutter web app.... (0.6s)
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

┌─ New feature ────────────────────────────────────────────────────────────────────────────┐
│ WebAssembly compilation is new. Understand the details before deploying to production. │
│ See https://flutter.dev/to/wasm for more information. │
└──────────────────────────────────────────────────────────────────────────────────────────┘
Upgrading .gitignore
Compiling lib\main.dart for the Web...
Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 257628 to 1472 bytes (99.4% reduction).
Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 8124 bytes (99.5% reduction).
Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Compiling lib\main.dart for the Web... 94.0s
✓ Built build\web
Yikes! It is possible that this error is caused by an internal issue with the Serverpod tooling. We would
appreciate if you filed an issue over at Github. Please include the stack trace below and describe any steps you did to
trigger the error.
https://github.com/serverpod/serverpod/issues

FormatException: Unexpected extension byte (at offset 5)

#0 _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1963:7)
#1 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:310:28)
#2 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:306:5)
#3 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:70:18)
#4 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:115:24)
#5 _rootRunUnary (dart:async/zone.dart:1538:47)
#6 _CustomZone.runUnary (dart:async/zone.dart:1429:19)
#7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1329:7)
#8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381:11)
#9 _DelayedData.perform (dart:async/stream_impl.dart:573:14)
#10 _PendingEvents.handleNext (dart:async/stream_impl.dart:678:11)
#11 _PendingEvents.schedule. (dart:async/stream_impl.dart:649:7)
#12 _rootRun (dart:async/zone.dart:1517:47)
#13 _CustomZone.run (dart:async/zone.dart:1422:19)
#14 _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
#15 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1362:23)
#16 _rootRun (dart:async/zone.dart:1525:13)
#17 _CustomZone.run (dart:async/zone.dart:1422:19)
#18 _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
#19 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1362:23)
#20 _microtaskLoop (dart:async/schedule_microtask.dart:40:35)
#21 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#22 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:127:13)
#23 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194:5)

To reproduce

.

Expected behavior

.

Library version

servepod 3.1.0
Flutter 3.35.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d693b4b9db (3 months ago) • 2025-09-16 14:27:41 +0000
Engine • hash feee8ee8fb8b975dd9990f86d3bda11e6e75faf3 (revision c298091351) (2 months ago) • 2025-09-15 14:04:24.000Z
Tools • Dart 3.9.2 • DevTools 2.48.0

Platform information

windows

Additional context

No response

How experienced are you with this library?

Intermediate - Familiar with the basics or have used it in a few projects

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    bug
    on Dec 17, 2025
  2. SandPod commented on Dec 17, 2025

    @SandPod
    Contributor

    @Metaildust Thanks for the report!

    What terminal or console are you using to run the Serverpod command?

    We don't do any more steps after this when creating a new project so your project should be in an OK state. I suspect we having issues with the introduced serverpod run futter_build command.

    If you step into your project and run this, do you see the same error?

    If so, if you remove the last part of the command defined in the pubpspec.yaml where the files are moved into the server directory. Do you still see the error?

  3. added
    in triage
    on Dec 17, 2025
  4. Metaildust commented on Dec 17, 2025

    @Metaildust
    Author

    @SandPod
    Windows PowerShell for console
    no debuging error if i run serverpod run flutter_build but some mojibake, i think that mojibake info is a error debug

    Running "flutter_build": cd ../gen_flutter && flutter build web --base-href /app/ --wasm && rm -rf ../gen_server/web/app
    && mv build/web/ ../gen_server/web/app
    Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
    
    ┌─ New feature ────────────────────────────────────────────────────────────────────────────┐
    │   WebAssembly compilation is new. Understand the details before deploying to production. │
    │   See https://flutter.dev/to/wasm for more information.                                  │
    └──────────────────────────────────────────────────────────────────────────────────────────┘
    Compiling lib\main.dart for the Web...                           1,628ms
    ✓ Built build\web
    'rm' �����ڲ����ⲿ���Ҳ���ǿ����еij���
    �����������
    

    I guess probably 2 error caused this on windows

    1. it used rm -rf and mv on windows caused error.
    2. Then, when debug, character encoding error between GBK and UTF-8
  5. SandPod commented on Dec 17, 2025

    @SandPod
    Contributor

    Yes, I think you are correct, we have 2 issues here.

    The create command would have completed successfully (just not copied the app to the web folder) if the output was possible to transform using utf-8 encoding.

    rm -rf is not recognized in your environment, making the command fail.

  6. SandPod commented on Dec 17, 2025

    @SandPod
    Contributor

    @Metaildust Do you have a fork of the repository? If so, could you attempt to apply #4468 and see if the crash disappears?

  7. SandPod commented on Dec 18, 2025

    @SandPod
    Contributor

    The 3.1.1 release includes the fix suggested above, try it out and see if that removes the CLI crash. We are also working on a more permanent fix for failing the build where we can specify the right command for the right environment: #4471

  8. moved this from Inbox 📫 to Next Up 🎯 in Serverpod Frameworkson Dec 18, 2025
  9. added
    area: cli
    and removed
    in triage
    on Dec 18, 2025
  10. Metaildust commented on Dec 18, 2025

    @Metaildust
    Author

    @SandPod thanks, I used new released. now no crush and still mojibake appears with flutter web app build failing.
    I've noticed that the flutter_build config in server's pubspec still uses rm -rf and mv to navigate so I guess it's under prediction. if it is, I think this issue can be closed.

    debug:

    ⠏ Building Flutter web app.... (0.7s)
    Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
    
    ┌─ New feature ────────────────────────────────────────────────────────────────────────────┐
    │   WebAssembly compilation is new. Understand the details before deploying to production. │
    │   See https://flutter.dev/to/wasm for more information.                                  │
    └──────────────────────────────────────────────────────────────────────────────────────────┘
    Upgrading .gitignore
    Compiling lib\main.dart for the Web...
    Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 257628 to 1472 bytes (99.4% reduction).
    Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
    Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 8124 bytes (99.5% reduction).
    Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
    Compiling lib\main.dart for the Web...                             92.3s
    ✓ Built build\web
    'rm' �����ڲ����ⲿ���Ҳ���ǿ����еij���
    �����������
    ✗ Building Flutter web app. (93.9s)
    
    ✓ Serverpod project created.
    

    where there's

    'rm' �����ڲ����ⲿ���Ҳ���ǿ����еij���
    �����������
    ✗ Building Flutter web app. (93.9s)
    
  11. moved this from Next Up 🎯 to In Progress 🔥 in Serverpod Frameworkson Jan 5, 2026
  12. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: clibug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions