Skip to content

returning debug macro statements results in an error #168

@toranb

Description

@toranb

I started the upgrade to ember-cli-babel v6.6.0 for one of my addons recently and found that when I destructure assert from @ember/debug the compiled output omits it for some odd reason. I'm writing to better understand if what I found is truly a regression of some kind or just me doing something I shouldn't be (and getting away with it prior to the v6.6.0 upgrade).

The import below is what doesn't work for dev or test builds any longer

import { assert } from '@ember/debug';

note: before using ember-cli-babel v6.6.0 I would pull assert from the global Ember

import Ember from 'ember';

const { assert } = Ember;

The difference is that prior to this import change and ember-cli-babel v6.6.0 my test build would run and assert would work as designed. Now I get an error saying assert is not defined when the test runs.

note: in dev tools when I capture this failure at test time and look at the imports / variable defs at the top of my module I don't see assert

screen shot 2017-07-26 at 6 53 07 am

Notice in the actual source for that file I have assert imported

screen shot 2017-07-26 at 6 56 13 am

I'm using ember-cli 2.13.0, ember 2.13.3 with node 6.10.2 and ember-cli-babel v6.6.0. For a full and complete repro checkout the branch I have up for the PR that bumps it to ember-cli-babel v6.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions