-
Notifications
You must be signed in to change notification settings - Fork 95
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
Hot reload does not work when changes include freezed models that embed a nullable realm model #1268
Comments
@stevenosse It has been a while since I have seen a compiler crash. Last time was regarding the Trying to follow your repro steps I must admit I cannot reproduce the issue. This is what I did flutter create bomb
cd bomb
flutter pub add realm
flutter pub run realm install
flutter pub run realm generate --watch Start vscode and edit main.dart to: import 'package:flutter/material.dart';
import 'package:realm/realm.dart';
part 'main.g.dart';
@RealmModel()
class _Stuff {
late int first;
}
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const Placeholder();
}
} Run this on (I used the iPhone 14 Pro Max simulator). Make a change - I replaced I tried more elaborate changes, like changing the actual realm model class Can you elaborate more on the exact steps you use? And perhaps a full project? I tried both flutter 3.17.12 (current stable) and 3.11.0-2.0.pre.73 (current master). |
Hello @nielsenko This breaks the compiler: part 'dummy_state.freezed.dart';
@freezed
class DummyState with _$DummyState {
factory DummyState({
required Dummy item,
RealmModel? storedItem,
}) = _Initial;
} To check this hypothesis, I redid the same one without freezed and the hot reload works again. I continue the investigation.
|
Answer from the Dart team: dart-lang/sdk#52312 (comment) |
This should be fixed with Flutter 3.10.1 (see flutter/flutter#124369 and https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#3101-may-17-2023) |
What happened?
I've noticed that when i try to hot reload a page that contains a Realm model, the Dart compiler crashes and i have to run
flutter clean
to get it work again. This has occured several times, on both windows and macOS.Other screens/files that does not import a realm model are not affected.
I've also created the associated issue on the Dart repo. Doing it here for tracking purpose: dart-lang/sdk#52312
Flutter doctor output:
Repro steps
Version
1.0.3
What Atlas Services are you using?
Local Database only
What type of application is this?
Flutter Application
Client OS and version
Pixel 7 Pro - Android 13, Xiaomi Mi 10T Pro - Android 11
Code snippets
No response
Stacktrace of the exception/crash you're getting
Relevant log output
No response
The text was updated successfully, but these errors were encountered: