Skip to content

NoSuchMethodError: method not found: 'pubspec' - This is an unexpected error. Please run ... #1183

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

Closed
DartBot opened this issue Jun 5, 2015 · 11 comments
Assignees
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

Originally opened as dart-lang/sdk#21490

This issue was originally filed by [email protected]


--- 11:19:57 Starting pub serve : gui ---
Loading source assets...
The null object does not have a getter 'pubspec'.

NoSuchMethodError: method not found: 'pubspec'
Receiver: null
Arguments: []
dart:core Object.noSuchMethod
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer.<fn>
dart:collection SetMixin.every
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 36 loadAllTransformers.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
This is an unexpected error. Please run

    pub --trace 'serve' 'web' '--port' '8080' '--admin-port' '49706' '--hostname' 'localhost'

and include the results in a bug report on http://dartbug.com/new.

First of all the command above does not work in Windows 7 - This did work for me: pub --trace serve web --port 8080 --admin-port 49706 --hostname localhost

What is the expected output? What do you see instead?
The expected output is that Chromium starts with my project.

What version of the product are you using?
Latest Dev Version

On what operating system?
Windows 7

Please provide any additional information below.

pub --trace serve web --port 8080 --admin-port 49706 --hostname localhost
Loading source assets...
The null object does not have a getter 'pubspec'.

NoSuchMethodError: method not found: 'pubspec'
Receiver: null
Arguments: []
dart:core Object.noSuchMethod
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer.<fn>
dart:collection SetMixin.every
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 36 loadAllTransformers.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async _Completer.completeError
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 218 loadAllTransformers.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async scheduleMicrotask
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 34 loadAllTransformers
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 574 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>.<fn>.<fn>.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async scheduleMicrotask
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 572 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>.<fn>.<fn>
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\log.dart 382 progress
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 570 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async scheduleMicrotask
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 567 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>
dart:async Future.Future.sync
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 814 AssetEnvironment._withStreamErrors
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 565 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>
dart:async _SyncCompleter.complete
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 815 AssetEnvironment._withStreamErrors.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async _Future.then
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 547 AssetEnvironment._load.<fn>.<fn>.join0.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async _Future.then
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 537 AssetEnvironment._load.<fn>.<fn>.join0
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 618 AssetEnvironment._load.<fn>.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async scheduleMicrotask
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 529 AssetEnvironment._load.<fn>
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\log.dart 382 progress
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 527 AssetEnvironment._load
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 82 AssetEnvironment.create.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async _Future.then
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 73 AssetEnvironment.create
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 99 ServeCommand.onRunTransformerCommand.<fn>.join0.join1
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 189 ServeCommand.onRunTransformerCommand.<fn>.join0
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 195 ServeCommand.onRunTransformerCommand.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async scheduleMicrotask
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 92 ServeCommand.onRunTransformerCommand
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\barback.dart 63 onRun
dart:async Future.Future.sync
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command.dart 206 PubCommand.run
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 164 invokeCommand.<fn>.break0.join0
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 177 invokeCommand.<fn>.break0
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 235 invokeCommand.<fn>.continue0
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 239 invokeCommand.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async scheduleMicrotask
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 145 invokeCommand
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 98 runPub.<fn>
dart:async Future.Future.sync
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\utils.dart 98 captureErrors.<fn>
package:stack_trace/src/chain.dart 78 Chain.capture
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\utils.dart 112 captureErrors
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 97 runPub
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 84 main.<fn>
dart:isolate _RawReceivePortImpl._handleMessage

---- Log transcript ----
FINE: Pub 1.8.0-dev.2.0
IO : Spawning "cmd /c ver" in W:\git\animatr.dart\gui.
IO : Finished ver. Exit code 0.
    | stdout:
    | |
    | | Microsoft Windows [Version 6.1.7601]
    | Nothing output on stderr.
FINE: Clean up system cache temp directory C:\Users\robert\AppData\Roaming\Pub\Cache_temp.
FINE: Loaded package graph.
FINE: Initializing barback...
FINE: Serving packages on localhost:0.
MSG : Loading source assets...
FINE: Providing sources for core|lib.
FINE: Providing sources for webui|lib.
FINE: Providing sources for gui|lib.
FINE: Loading source assets finished (0.0s).
FINE: Provided sources.
FINE: Loading transformers...
FINE: Loading transformers finished (0.0s).
FINE: Initializing barback finished (0.1s).
ERR : The null object does not have a getter 'pubspec'.
    |
    | NoSuchMethodError: method not found: 'pubspec'
    | Receiver: null
    | Arguments: []
FINE: Exception type: NoSuchMethodError
ERR : dart:core Object.noSuchMethod
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer.<fn>
    | dart:collection SetMixin.every
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 36 loadAllTransformers.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Completer.completeError
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 218 loadAllTransformers.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async scheduleMicrotask
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\load_all_transformers.dart 34 loadAllTransformers
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 574 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>.<fn>.<fn>.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async scheduleMicrotask
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 572 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>.<fn>.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\log.dart 382 progress
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 570 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async scheduleMicrotask
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 567 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 814 AssetEnvironment._withStreamErrors
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 565 AssetEnvironment._load.<fn>.<fn>.join0.<fn>.<fn>
    | dart:async _SyncCompleter.complete
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 815 AssetEnvironment._withStreamErrors.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 547 AssetEnvironment._load.<fn>.<fn>.join0.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 537 AssetEnvironment._load.<fn>.<fn>.join0
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 618 AssetEnvironment._load.<fn>.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async scheduleMicrotask
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 529 AssetEnvironment._load.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\log.dart 382 progress
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 527 AssetEnvironment._load
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 82 AssetEnvironment.create.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\barback\asset_environment.dart 73 AssetEnvironment.create
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 99 ServeCommand.onRunTransformerCommand.<fn>.join0.join1
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 189 ServeCommand.onRunTransformerCommand.<fn>.join0
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 195 ServeCommand.onRunTransformerCommand.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async scheduleMicrotask
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\serve.dart 92 ServeCommand.onRunTransformerCommand
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command\barback.dart 63 onRun
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\command.dart 206 PubCommand.run
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 164 invokeCommand.<fn>.break0.join0
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 177 invokeCommand.<fn>.break0
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 235 invokeCommand.<fn>.continue0
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 239 invokeCommand.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async scheduleMicrotask
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 145 invokeCommand
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 98 runPub.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\utils.dart 98 captureErrors.<fn>
    | package:stack_trace/src/chain.dart 78 Chain.capture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\lib\src\utils.dart 112 captureErrors
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 97 runPub
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub_generated\bin\pub.dart 84 main.<fn>
    | dart:isolate _RawReceivePortImpl._handleMessage

---- End log transcript ----

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


Deleting my pub cache resolved the issue. It looks like I had a package in there with no pubspec.yaml (it just was an empty directory).

@DartBot DartBot added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) Fixed labels Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/5449880?v=3" align="left" width="48" height="48"hspace="10"> Comment by iposva-google


Added Area-Pub, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


I can't reproduce this. When I delete the contents of a package in my cache, I get a descriptive 'Could not find a file name "pubspec.yaml" in ...' message.

If you can consistently reproduce this, can you provide the specific steps to do so?


Added CannTriaged label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Added CannotReproduce label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


Got the same error after I run pup upgrade on a local referenced project/lib.
The error disappeared after running pup upgrade on the referencing project.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


I am seeing this on 1.9.3 and 1.10 rc when I try to add the dependency 'Myth' (https://pub.dartlang.org/packages/myth) to dependencies or dev_dependencies any project.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


log attached


Attachment:
test.log (16.39 KB)

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Thanks for the repro! Looking into it now.


Set owner to @nex3.
Added Started label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Fixed by dart-lang/sdk@697f93d.


Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Issue #19 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Issue #24 has been merged into this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants