Skip to content

Pub can't use transformers from dev dependencies. #1324

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
mit-mit opened this issue Sep 2, 2015 · 1 comment
Closed

Pub can't use transformers from dev dependencies. #1324

mit-mit opened this issue Sep 2, 2015 · 1 comment
Labels
closed-duplicate Closed in favor of an existing report

Comments

@mit-mit
Copy link
Member

mit-mit commented Sep 2, 2015

From @dglinyanov on July 8, 2015 7:57

According to FAQ:
$ uname -a
Linux glinyanov-PC 3.14.14-031414-generic #201407281153 SMP Mon Jul 28 15:54:19 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ pub version
Pub 1.9.3
$ pub --verbose update > pub.log 2>&1
pub.log is here: https://goo.gl/PL1cUU

My team was working on refactoring and extracting libraries to separate repositories in particular, and we found a bug, that we could reproduce: if in package:A we use package:test as dev_dependency and use test/pub_serve transfomer, then if in package:B we use package:A as 'git' dependency (and NOT 'path' dependency), then pub get/update for package:B fails with exception:

Loading source assets... 
The null object does not have a getter 'pubspec'.

NoSuchMethodError: method not found: 'pubspec'
Receiver: null
Arguments: []
dart:core
... # more in pub.log

I created the example packages to show it, it's here: https://goo.gl/2k8Kea.

Nevertheless, my real project builds successfully even after bad pub update, meaning pub build does not fail, and package:A itself can successfully use that transformer.

For those, who experience same issue: move your transformer's dependency from dev_dependencies to dependencies (e.g. test for test/pub_serve), it solves the problem.

Copied from original issue: dart-lang/sdk#23805

@nex3
Copy link
Member

nex3 commented Sep 2, 2015

Duplicate of #1183.

@nex3 nex3 closed this as completed Sep 2, 2015
@nex3 nex3 added the closed-duplicate Closed in favor of an existing report label Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants