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

build/serve crash: Unhandled exception: Could not import file builder.dart #995

Closed
afpatmin opened this issue Feb 10, 2018 · 5 comments
Closed

Comments

@afpatmin
Copy link

afpatmin commented Feb 10, 2018

When trying to run command 'pub run build_runner serve' / 'pub run build_runner build',
the terminal outputs:

[INFO] Entrypoint: Generating build script completed, took 421ms
Unhandled exception:
IsolateSpawnException: Unable to spawn isolate: Unhandled exception:
Could not import "file:///X:/project/tool/src/builder.dart" 
from "file:///X:/project/.dart_tool/build/entrypoint/build.dart": 
FileSystemException: Cannot open file, path = 'X:\project\tool\src\builder.dart' 
(OS Error: Det går inte att hitta sökvägen., errno = 3)
null

The issue occured after upgrading build_runner from v 0.7.9+2 to v 0.7.10.

The project doesn't contain a build.yaml or any build.dart scripts

build_runner: 0.7.10
OS: Windows 10
SDK: 2.0.0-dev.22.0
IDE: Webstorm 2017.3.4

@afpatmin afpatmin changed the title build/serve crash: Unhandled exception: Could not import "file:///X:/project/tool/src/builder.dart" build/serve crash: Unhandled exception: Could not import file builder.dart Feb 10, 2018
@afpatmin
Copy link
Author

afpatmin commented Feb 10, 2018

travis reported this too: https://travis-ci.org/dart-lang/build/jobs/339725849

@luisvt
Copy link

luisvt commented Feb 10, 2018

The error is caused because of built_value dependency. It looks like its configuration is asking to create a builder.dart file into tool/src folder. As work around I created tool/src/builder.dart containing next code:

import 'package:build/build.dart';

Builder builtValueBuilder(_) => null;

@jakemac53
Copy link
Contributor

jakemac53 commented Feb 10, 2018

Ya this is caused by a local builder defined in code_builder which we end up trying to import even though it never applies to anything.

You can force code_builder version 3.0.1 in dependency_overrides to fix. We will come out with a fix soon as well.

@matanlurey
Copy link
Contributor

Fixed by dart-lang/code_builder#198, and published as 3.0.3.

If you run pub upgrade the crashes should go away.

@jakemac53
Copy link
Contributor

thanks @matanlurey, I am working on a fix in build_runner as well

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