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

Unable to build on windows #3

Closed
SuperPenguin opened this issue Jun 4, 2022 · 3 comments
Closed

Unable to build on windows #3

SuperPenguin opened this issue Jun 4, 2022 · 3 comments

Comments

@SuperPenguin
Copy link

PS C:\Users\andre\Desktop> jaspr create try_jaspr
Creating try_jaspr using template web-simple...

  .gitignore
  analysis_options.yaml
  CHANGELOG.md
  pubspec.yaml
  README.md
  web\index.html
  web\main.dart
  web\styles.css

  lib/app.dart
  lib/app.dart

Resolving dependencies...
Changed 81 dependencies!

Created project try_jaspr in try_jaspr! In order to get started, run the following commands:

  cd try_jaspr
  jaspr serve

PS C:\Users\andre\Desktop> cd try_jaspr
PS C:\Users\andre\Desktop\try_jaspr> jaspr build
Unhandled exception:
Unsupported operation: Cannot extract a file path from a c URI
#0      _Uri.toFilePath (dart:core/uri.dart:2825:7)
#1      new Directory.fromUri (dart:io/directory.dart:129:59)
#2      BuildCommand.run (file:///C:/Users/andre/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/jaspr-0.1.2/bin/jaspr.dart:237:25)
#3      CommandRunner.runCommand (package:args/command_runner.dart:209:27)
#4      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:119:25)
#5      new Future.sync (dart:async/future.dart:301:31)
#6      CommandRunner.run (package:args/command_runner.dart:119:14)
#7      main (file:///C:/Users/andre/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/jaspr-0.1.2/bin/jaspr.dart:23:31)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
Unhandled exception:
Unsupported operation: Cannot extract a file path from a c URI
#0      _Uri.toFilePath (dart:core/uri.dart:2825:7)
#1      new Directory.fromUri (dart:io/directory.dart:129:59)
#2      BuildCommand.run (file:///C:/Users/andre/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/jaspr-0.1.2/bin/jaspr.dart:237:25)
#3      CommandRunner.runCommand (package:args/command_runner.dart:209:27)
#4      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:119:25)
#5      new Future.sync (dart:async/future.dart:301:31)
#6      CommandRunner.run (package:args/command_runner.dart:119:14)
#7      main (file:///C:/Users/andre/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/jaspr-0.1.2/bin/jaspr.dart:23:31)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
PS C:\Users\andre\Desktop\try_jaspr>
@SuperPenguin
Copy link
Author

Seems this is the culprit

var dir = Directory.fromUri(Uri.parse(Directory.current.path + "/build"));

import 'dart:io';

void main(List<String> arguments) {
  final uri = Directory.current.uri;
  print(uri); // file:///C:/Users/andre/Desktop/New%20folder/hello/
  print(uri.scheme); // file
  final dir = Directory.fromUri(uri); // ok

  final uri2 = Uri.parse(Directory.current.path);
  print(uri2); // c:%5CUsers%5Candre%5CDesktop%5CNew%20folder%5Chello
  print(uri2.scheme); // c
  final dir2 = Directory.fromUri(uri2); // error
}

@schultek
Copy link
Owner

schultek commented Jun 4, 2022

Thanks for investigating, this seems like an easy fix.

@schultek
Copy link
Owner

schultek commented Jun 6, 2022

Fixed in version 0.1.3

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

2 participants