Skip to content
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

Make errors #1134

Open
Big-Mande opened this issue Aug 9, 2023 · 4 comments
Open

Make errors #1134

Big-Mande opened this issue Aug 9, 2023 · 4 comments

Comments

@Big-Mande
Copy link

I was able to use the make get command but running the make command give me these errors:
tool/lib/src/book.dart:118:56: Error: The method 'listSync' isn't defined for the class 'Glob'.

  • 'Glob' is from 'package:glob/glob.dart' ('../../.pub-cache/hosted/pub.dartlang.org/glob-2.1.1/lib/glob.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'listSync'.
    for (var file in Glob("$language/**.{c,h,java}").listSync()) {
    ^^^^^^^^
    tool/lib/src/book.dart:158:52: Error: The value 'null' can't be returned from a function with return type 'Page' because 'Page' is not nullable.
  • 'Page' is from 'package:tool/src/page.dart' ('tool/lib/src/page.dart').
    if (index < 0 || index >= pages.length) return null;
    ^
    tool/lib/src/book.dart:162:48: Error: A value of type 'Snippet?' can't be returned from a function with return type 'Snippet' because 'Snippet?' is nullable and 'Snippet' isn't.
  • 'Snippet' is from 'package:tool/src/snippet.dart' ('tool/lib/src/snippet.dart').
    Snippet findSnippet(CodeTag tag) => _snippets[tag];
    ^
    tool/lib/src/book.dart:171:11: Error: Non-nullable variable 'last' must be assigned before it can be used.
    if (last == null || snippet.tag > last.tag) last = snippet;
    ^^^^
    tool/lib/src/book.dart:171:41: Error: Non-nullable variable 'last' must be assigned before it can be used.
    if (last == null || snippet.tag > last.tag) last = snippet;
    ^^^^
    tool/lib/src/book.dart:174:12: Error: Non-nullable variable 'last' must be assigned before it can be used.
    return last;
    ^^^^
    tool/lib/src/mustache.dart:58:19: Error: Non-nullable variable 'chapters' must be assigned before it can be used.
    "chapters": chapters,
    ^^^^^^^^
    tool/lib/src/mustache.dart:74:20: Error: Non-nullable variable 'nextType' must be assigned before it can be used.
    "next_type": nextType,
    ^^^^^^^^
    tool/lib/src/page.dart:50:24: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable.
    if (isPart) return null;
    ^
    tool/lib/src/page.dart:51:14: Error: Property 'title' cannot be accessed on 'Page?' because it is potentially null.
  • 'Page' is from 'package:tool/src/page.dart' ('tool/lib/src/page.dart').
    Try accessing using ?. instead.
    if (part.title == "A Tree-Walk Interpreter") return "java";
    ^^^^^
    make: *** [build/build.dart.snapshot] Error 254
@Viha123
Copy link

Viha123 commented Oct 13, 2023

similar situation, I downgraded the dart to 2.19 so make-get works but then make doesn't work. Were you able to fix it?
Edit: figured out that on dart 2.19.6-1 the make get and make clox seems to work.

@a-y-u-s-h
Copy link

similar situation, I downgraded the dart to 2.19 so make-get works but then make doesn't work. Were you able to fix it? Edit: figured out that on dart 2.19.6-1 the make get and make clox seems to work.

How did you do that exactly? I'm not from ecosystem and can't seem to figure this out.

@a-y-u-s-h
Copy link

Okay, I just followed the errors and updated them by hand (thought there must be a command for this) this is updated one, but not sure if it breaks anything -

name: tool
publish_to: none
environment:
  sdk: ">=2.12.0 <3.0.0"
dependencies:
  args: ^2.0.0
  charcode: ^1.1.3
  glob: ^2.0.0
  image: ^3.0.1
  markdown: ^4.0.0
  mime_type: ^1.0.0
  mustache_template: ^2.0.0
  path: ^1.7.0
  pool: ^1.4.0
  sass: ^1.26.5
  shelf: ^1.0.0
  string_scanner: ^1.0.5

@br8th
Copy link

br8th commented Apr 7, 2024

installing dart v2.19.6 works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants