schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs, SSR and SSG.
https://jasprpad.schultek.de
MIT License
1.07k stars 65 forks source link

fix: [jaspr_riverpod] vsyncOverride is missing a variable #138

Closed gadfly361 closed 8 months ago

gadfly361 commented 9 months ago

Description

When trying to run the examples/flutter_embedding example, get the following error:

 ~/gadfly/temp/jaspr/examples/flutter_embedding/ [main*] jaspr serve
✓ [CLI] Starting jaspr in development mode... (5.3s)
[BUILDER] [ERROR] Error compiling dartdevc module:jaspr_riverpod|lib/jaspr_riverpod.ddc.js
[BUILDER] [ERROR] 
[BUILDER] [ERROR] packages/jaspr_riverpod/src/framework.dart:317:5: Error: The getter 'vsyncOverride' isn't defined for the class '_UncontrolledProviderScopeElement'.
[BUILDER] [ERROR] - '_UncontrolledProviderScopeElement' is from 'package:jaspr_riverpod/src/framework.dart' ('packages/jaspr_riverpod/src/framework.dart').
[BUILDER] [ERROR] Try correcting the name to the name of an existing getter, or defining a getter or field named 'vsyncOverride'.
[BUILDER] [ERROR] vsyncOverride ??= _jasprVsync;
[BUILDER] [ERROR] ^^^^^^^^^^^^^
[BUILDER] [ERROR] packages/jaspr_riverpod/src/framework.dart:317:5: Error: The setter 'vsyncOverride' isn't defined for the class '_UncontrolledProviderScopeElement'.
[BUILDER] [ERROR] - '_UncontrolledProviderScopeElement' is from 'package:jaspr_riverpod/src/framework.dart' ('packages/jaspr_riverpod/src/framework.dart').
[BUILDER] [ERROR] Try correcting the name to the name of an existing setter, or defining a setter or field named 'vsyncOverride'.
[BUILDER] [ERROR] vsyncOverride ??= _jasprVsync;
[BUILDER] [ERROR] ^^^^^^^^^^^^^
[BUILDER] [ERROR] packages/jaspr_riverpod/src/framework.dart:373:9: Error: The getter 'vsyncOverride' isn't defined for the class '_UncontrolledProviderScopeElement'.
[BUILDER] [ERROR] - '_UncontrolledProviderScopeElement' is from 'package:jaspr_riverpod/src/framework.dart' ('packages/jaspr_riverpod/src/framework.dart').
[BUILDER] [ERROR] Try correcting the name to the name of an existing getter, or defining a getter or field named 'vsyncOverride'.
[BUILDER] [ERROR] if (vsyncOverride == _jasprVsync) {
[BUILDER] [ERROR] ^^^^^^^^^^^^^
[BUILDER] [ERROR] packages/jaspr_riverpod/src/framework.dart:374:7: Error: The setter 'vsyncOverride' isn't defined for the class '_UncontrolledProviderScopeElement'.
[BUILDER] [ERROR] - '_UncontrolledProviderScopeElement' is from 'package:jaspr_riverpod/src/framework.dart' ('packages/jaspr_riverpod/src/framework.dart').
[BUILDER] [ERROR] Try correcting the name to the name of an existing setter, or defining a setter or field named 'vsyncOverride'.
[BUILDER] [ERROR] vsyncOverride = null;

Steps To Reproduce

  1. Clone jaspr repo (this Issue was made against the commit: 3495cfd0693fed99a34ffec0f9f0b8ac9bbfb18e)
  2. cd examples/flutter_embedding
  3. install dependencies
  4. jaspr serve

Doctor Output

 ~/gadfly/temp/jaspr/examples/flutter_embedding/ [main*] jaspr doctor
[✓] Jaspr CLI (Version 0.9.3)
  • Dart Version 3.1.1 (stable) (Tue Sep 5 12:20:14 2023 +0000) on "macos_x64" at /Users/matthew/fvm/versions/3.13.3/bin/cache/dart-sdk/bin/dart
  • Running on macos Version 13.3.1 (a) (Build 22E772610a) - Locale en-US
  • Analytics: Enabled

[✓] Current Project
  • Dependencies on core packages:
    • jaspr: ^0.9.0
    • jaspr_builder: ^0.9.0 (dev)
    • jaspr_web_compilers: ^4.0.5 (dev)
    • jaspr_flutter_embed: ^0.1.4
    • jaspr_riverpod: ^0.3.6
  • Uses server-side rendering: true
  • Uses experimental compilers: true
  • Uses flutter embedding: true

Expected Behavior

For the flutter_embedding example to have been served to localhost:8080 without hitting an error.

Additional Context

I think this commit may have introduced the regression.

schultek commented 9 months ago

This actually comes from a change in riverpod, where vsyncOverride was removed in the latest version: https://github.com/rrousselGit/riverpod/pull/3072

So we definitely need to fix this, but we also need to update the version constraint for riverpod.

gadfly361 commented 9 months ago

@schultek Thanks for finding the root cause! I updated #139 accordingly