Skip to content

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

Closed
@mit-mit

Description

@mit-mit

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nex3@mit-mit

        Issue actions

          Pub can't use transformers from dev dependencies. · Issue #1324 · dart-lang/pub