schultek / jaspr

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

Error running app/ dart_quotes_server examples #265

Closed alihassan143 closed 3 months ago

alihassan143 commented 3 months ago

Description Analyzer did not able to find any annotations like @css and Document.head constructor

Additional Context

Screenshot 2024-08-06 at 5 02 28 PM

[SERVER] [ERROR] lib/src/routes/root.dart:20:13: Error: The method 'fontFace' isn't defined for the class 'NestedStyleRule Function(String, [List<StyleRule>])'.
[SERVER] [ERROR] - 'NestedStyleRule' is from 'package:jaspr/src/components/style.dart' ('../../../../.pub-cache/hosted/pub.dev/jaspr-0.13.3/lib/src/components/style.dart').
[SERVER] [ERROR] - 'List' is from 'dart:core'.
[SERVER] [ERROR] - 'StyleRule' is from 'package:jaspr/src/components/style.dart' ('../../../../.pub-cache/hosted/pub.dev/jaspr-0.13.3/lib/src/components/style.dart').
[SERVER] [ERROR] Try correcting the name to the name of an existing method, or defining a method named 'fontFace'.
[SERVER] [ERROR] css.fontFace(fontFamily: "Roboto", url: "/fonts/Roboto-Regular.woff"),
[SERVER] [ERROR] ^^^^^^^^
[SERVER] [ERROR] lib/src/routes/root.dart:21:13: Error: The method 'fontFace' isn't defined for the class 'NestedStyleRule Function(String, [List<StyleRule>])'.
[SERVER] [ERROR] - 'NestedStyleRule' is from 'package:jaspr/src/components/style.dart' ('../../../../.pub-cache/hosted/pub.dev/jaspr-0.13.3/lib/src/components/style.dart').
[SERVER] [ERROR] - 'List' is from 'dart:core'.
[SERVER] [ERROR] - 'StyleRule' is from 'package:jaspr/src/components/style.dart' ('../../../../.pub-cache/hosted/pub.dev/jaspr-0.13.3/lib/src/components/style.dart').
[SERVER] [ERROR] Try correcting the name to the name of an existing method, or defining a method named 'fontFace'.
[SERVER] [ERROR] css.fontFace(fontFamily: "Roboto", fontStyle: FontStyle.italic, url: "/fonts/Roboto-Italic.woff"),
[SERVER] [ERROR] ^^^^^^^^
[SERVER] [ERROR] lib/src/routes/root.dart:24:13: Error: The method 'fontFace' isn't defined for the class 'NestedStyleRule Function(String, [List<StyleRule>])'.
[SERVER] [ERROR] - 'NestedStyleRule' is from 'package:jaspr/src/components/style.dart' ('../../../../.pub-cache/hosted/pub.dev/jaspr-0.13.3/lib/src/components/style.dart').
[SERVER] [ERROR] - 'List' is from 'dart:core'.
[SERVER] [ERROR] - 'StyleRule' is from 'package:jaspr/src/components/style.dart' ('../../../../.pub-cache/hosted/pub.dev/jaspr-0.13.3/lib/src/components/style.dart').
[SERVER] [ERROR] Try correcting the name to the name of an existing method, or defining a method named 'fontFace'.
[SERVER] [ERROR] css.fontFace(fontFamily: "icomoon", url: "/fonts/icomoon.ttf"),
[SERVER] [ERROR] ^^^^^^^^
[SERVER] [ERROR] lib/web/pages/quote_page.dart:24:20: Error: Member not found: 'Document.head'.
[SERVER] [ERROR] yield Document.head(
[SERVER] [ERROR] ^^^^
[SERVER] 
schultek commented 3 months ago

The main branch has some unreleased changes and new features, and the example is already updated to use them. You can checkout the latest release tag and use the example from then.

alihassan143 commented 3 months ago

can you guide little bit after checkout to latest tag I cannot able to find the quotes server init

schultek commented 3 months ago

Sorry yes, the serverpod examples didn't exist yet for the last release tag. I'm working on the next release which will also resolve this problem, but until then you can use the codebase at that point in time: https://github.com/schultek/jaspr/tree/883b0ac0d4d48f08ff4effa580c1c5c71dafd437

alihassan143 commented 3 months ago
 dart pub get
Resolving dependencies... 
The current Dart SDK version is 3.5.0.

Because jaspr_web_compilers 4.0.9 requires SDK version >=3.1.0 <3.5.0 and no versions of jaspr_web_compilers match >4.0.9 <5.0.0, jaspr_web_compilers ^4.0.9 is forbidden.
So, because dart_quotes_server depends on jaspr_web_compilers ^4.0.9, version solving failed.

You can try the following suggestion to make the pubspec resolve:
* Try using the Dart SDK version: 3.4.4. See https://dart.dev/get-dart.
mac@Macs-Mac-mini dart_quotes_server % 

I am using flutter 3.2.4

schultek commented 3 months ago

Released 4.0.10 that supports dart 3.5.0

alihassan143 commented 3 months ago

Screenshot 2024-08-13 at 5 45 07 PM Now getting this error

schultek commented 3 months ago

The new version has now been released. You should try again using the latest jaspr version and the updated example from the repo.

Feel free to reopen if there is still an error.

alihassan143 commented 3 months ago
 jaspr serve 
[CLI] Running jaspr in server rendering mode.
[BUILDER] [ERROR] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
[BUILDER] [ERROR] This is likely caused by a misconfigured builder definition.
Bad state: Unable to start build daemon.

now getting this error is all examples

TJMusiitwa commented 3 months ago
 jaspr serve 
[CLI] Running jaspr in server rendering mode.
[BUILDER] [ERROR] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
[BUILDER] [ERROR] This is likely caused by a misconfigured builder definition.
Bad state: Unable to start build daemon.

now getting this error is all examples

@schultek Confirming that I am getting this error as well. Just updating to the latest version

Jaspr Doctor Output


[✓] Jaspr CLI (Version 0.14.0)
  • Dart Version 3.4.3 (stable) (Tue Jun 4 19:51:39 2024 +0000) on "macos_arm64" at /Users/admin/development/flutter/bin/cache/dart-sdk/bin/dart
  • Running on macos Version 14.1.2 (Build 23B92) - Locale en-GB
  • Analytics: Enabled

[✓] Current Project
  • Dependencies on core packages:
    • jaspr: ^0.14.0
    • jaspr_builder: ^0.14.0 (dev)
    • jaspr_router: ^0.5.0
  • Rendering mode: static
  • Uses jaspr compilers: false
  • Uses flutter embedding: false
schultek commented 3 months ago

Try doing

jaspr clean dart pub upgrade jaspr serve -v

alihassan143 commented 3 months ago

@schultek already did but didn't work

schultek commented 3 months ago

Working on a potential fix.

alihassan143 commented 3 months ago

@schultek the error is in server pod auth module because they are using old version of image cropper package that is causing the issue

alihassan143 commented 3 months ago

i tried firebase example it works without any issue

schultek commented 3 months ago

This should be fixed again. Pull the latest main branch and run dart pub upgrade.

If you still have a problem please open a new issue with a detailed description.