File tree Expand file tree Collapse file tree
website/content/docs/guides Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,6 +218,31 @@ export default config
218218npm run generate
219219```
220220
221+ ## Troubleshooting
222+
223+ ### ` build_runner ` fails when the project also depends on ` amplify_flutter `
224+
225+ After generating your Freezed-annotated models, you still need to run Freezed's own code generation
226+ step (` dart run build_runner build ` or ` flutter pub run build_runner build ` ) to produce the
227+ ` .freezed.dart ` /` .g.dart ` files. If your Flutter project also depends on ` amplify_flutter ` , this step
228+ can fail while ` build_runner ` tries to compile its build script.
229+
230+ This isn't a bug in ` flutter-freezed ` or GraphQL Code Generator. ` amplify_flutter ` transitively
231+ depends on ` sqlite3 ` and ` jni ` , both of which declare Dart's
232+ [ Native Assets ("build hooks")] ( https://github.com/dart-lang/native ) feature. ` build_runner ` compiles
233+ its build script into a native (AOT) executable, and currently fails outright whenever any dependency
234+ in the graph declares a build hook — tracked upstream at
235+ [ dart-lang/native #2792 ] ( https://github.com/dart-lang/native/issues/2792 ) .
236+
237+ ** Workaround:** run ` build_runner ` in JIT mode instead of compiling an AOT snapshot:
238+
239+ ``` sh
240+ dart run build_runner build --no-precompile
241+ ```
242+
243+ This is a temporary workaround until the underlying incompatibility between ` build_runner ` and Dart's
244+ native-assets tooling is resolved upstream.
245+
221246## Configuring the plugin
222247
223248To configure the plugin, you need to first understand how to use Patterns to configure specific
You can’t perform that action at this time.
0 commit comments