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

Not compatible with ember-cli@2.13 #182

Closed
simonexmachina opened this issue Mar 23, 2017 · 22 comments
Closed

Not compatible with ember-cli@2.13 #182

simonexmachina opened this issue Mar 23, 2017 · 22 comments
Assignees
Labels

Comments

@simonexmachina
Copy link

simonexmachina commented Mar 23, 2017

I just created a clean test project with ember-cli@2.13 using ember new ember-test --yarn then ran ember install ember-cli-mocha and now ember s fails with the following error message:

$ ember s
Livereload server on http://localhost:49153
File: ember-mocha.js
The Broccoli Plugin: [broccoli-persistent-filter:Babel > [Babel: Ember CLI Mocha]: Babel: Ember CLI Mocha] failed with:
TypeError: The plugin [null,{}] didn't export a Plugin instance
    at PluginManager.validate (/Users/simonwade/Temp/test-ember/node_modules/babel-core/lib/transformation/file/plugin-manager.js:164:13)
    at PluginManager.add (/Users/simonwade/Temp/test-ember/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
    at File.buildTransformers (/Users/simonwade/Temp/test-ember/node_modules/babel-core/lib/transformation/file/index.js:237:21)
    at new File (/Users/simonwade/Temp/test-ember/node_modules/babel-core/lib/transformation/file/index.js:139:10)
    at Pipeline.transform (/Users/simonwade/Temp/test-ember/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at Babel.transform (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-mocha/node_modules/broccoli-babel-transpiler/index.js:107:21)
    at Babel.processString (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-mocha/node_modules/broccoli-babel-transpiler/index.js:206:25)
    at Promise.then.result.output (/Users/simonwade/Temp/test-ember/node_modules/broccoli-persistent-filter/lib/strategies/persistent.js:41:23)
    at initializePromise (/Users/simonwade/Temp/test-ember/node_modules/rsvp/dist/rsvp.js:589:5)
    at new Promise$1 (/Users/simonwade/Temp/test-ember/node_modules/rsvp/dist/rsvp.js:1077:33)

The broccoli plugin was instantiated at:
    at Babel.Plugin (/Users/simonwade/Temp/test-ember/node_modules/broccoli-plugin/index.js:7:31)
    at Babel.Filter [as constructor] (/Users/simonwade/Temp/test-ember/node_modules/broccoli-persistent-filter/index.js:62:10)
    at new Babel (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-mocha/node_modules/broccoli-babel-transpiler/index.js:35:10)
    at Babel (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-mocha/node_modules/broccoli-babel-transpiler/index.js:30:12)
    at Object.toTree (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-mocha/node_modules/ember-cli-babel/index.js:30:52)
    at /Users/simonwade/Temp/test-ember/node_modules/ember-cli-preprocess-registry/preprocessors.js:180:26
    at Array.forEach (native)
    at processPlugins (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-preprocess-registry/preprocessors.js:178:11)
    at Function.module.exports.preprocessJs (/Users/simonwade/Temp/test-ember/node_modules/ember-cli-preprocess-registry/preprocessors.js:171:10)
    at Class.preprocessJs (/Users/simonwade/Temp/test-ember/node_modules/ember-cli/lib/models/addon.js:1104:25)
@rwjblue
Copy link
Member

rwjblue commented Mar 23, 2017

What is your environment? Is this under npm@2, npm@3, yarn, etc? What node version?

@rwjblue
Copy link
Member

rwjblue commented Mar 23, 2017

Can you push up a demo app, including node_modules, so we can take a look at what is going on?

@simonexmachina
Copy link
Author

Sorry, I should have indicated I used ember new test-ember --yarn with yarn@0.18.1 and node@7.6.0.

@simonexmachina
Copy link
Author

@simonexmachina
Copy link
Author

That's pushed now

@Turbo87
Copy link
Member

Turbo87 commented Mar 23, 2017

I can reproduce this with just:

ember new foo --yarn
cd foo
ember install ember-cli-mocha
ember serve

@aexmachina thanks for the reproduction!

@Turbo87
Copy link
Member

Turbo87 commented Mar 23, 2017

$ yarn list broccoli-babel-transpiler
yarn list v0.21.3
├─ broccoli-babel-transpiler@5.6.2
├─ ember-cli-babel@6.0.0-beta.9
│  └─ broccoli-babel-transpiler@6.0.0
├─ ember-cli@2.13.0-beta.2
│  └─ broccoli-babel-transpiler@6.0.0-alpha.3
└─ ember-data@2.13.0-beta.3
│  └─ broccoli-babel-transpiler@6.0.0

$ yarn why broccoli-babel-transpiler
yarn why v0.21.3
[1/4] 🤔  Why do we have the module "broccoli-babel-transpiler"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
info Has been hoisted to "broccoli-babel-transpiler"
info Reasons this module exists
   - "ember-cli-mocha" depends on it
   - "ember-ajax#ember-cli-babel" depends on it
info Disk size without dependencies: "13.14MB"
info Disk size with unique dependencies: "13.72MB"
info Disk size with transitive dependencies: "34.59MB"
info Amount of shared dependencies: 79

This seems to be an issue inside of Ember CLI. After yarn add ember-cli@2.12.1 everything builds and runs fine again.

@rwjblue
Copy link
Member

rwjblue commented Apr 1, 2017

Good news!! I have determined the issue here...

It comes down to issues with npm non-determinism. I have a solution, but it will involve fixes upstream in ember-cli.

@Turbo87
Copy link
Member

Turbo87 commented Apr 1, 2017

cool, thanks!

@stefanpenner
Copy link

stefanpenner commented Apr 17, 2017

I have a solution

Just spoke to @rwjblue, the solution is:

No longer trust npm to do npm install <package>, because they appear to only consider <package> dependencies, not the full graph. They bork stuff up. We should confirm that latest yarn has or doesn't have this problem. If it does, the solution for us would be either:

  • do nothing, tell people to rimraf node_modules and try again
  • on packageInstall manually update package.json to include the new or updated version, and then run npm install. <-- @rwjblue's solution

@stefanpenner
Copy link

@Turbo87 I suspect we want to do the second one, as this will give a better user experience. What are your thoughts?

@Turbo87
Copy link
Member

Turbo87 commented Apr 17, 2017

@stefanpenner I'm not yet convinced that this is actually the issue or solution. I'd be very surprised if npm would be that broken. I'm instead suspecting that something is not resolving from the correct cwd.

@Turbo87
Copy link
Member

Turbo87 commented Apr 17, 2017

Also I had the same issue with yarn, and yarn is supposed to have stable output which seems to be another hint that something else might be wrong.

@stefanpenner
Copy link

@Turbo87 ah, ok. So it sounds like this needs more exploration?

@Turbo87
Copy link
Member

Turbo87 commented Apr 18, 2017

it sounds like this needs more exploration?

yes. the problem is that I am not aware of what could have caused this to break in Ember CLI itself since it all works fine with the v2.12 releases.

@runspired
Copy link

I'd be very surprised if npm would be that broken. I'm instead suspecting that something is not resolving from the correct cwd.

npm is that broken, I deal with this particular bug often. The solution to manually add to package.json and then run npm install should work, but I often find myself going for the more nuclear option (also mentioned above) of rm -rf node_modules prior to install.

@runspired
Copy link

Also, fwiw, I've noticed this in prior ember-cli releases, but it's become more problematic recently because of the babel6 upgrade and a few other dependency bumps. I don't think this is an issue with ember-cli because I have been able manually recreate this problem without the involvement of any cli commands.

@Turbo87
Copy link
Member

Turbo87 commented Apr 18, 2017

npm is that broken, I deal with this particular bug often

what particular bug are you talking about? I'm not sure we're all talking about the same things here...

I don't think this is an issue with ember-cli

since downgrading ember-cli to v2.12 solves the issue I'm pretty sure it is an issue in ember-cli or at least surfaced by ember-cli v2.13-beta

@kevinansfield
Copy link

I've tried upgrading Ghost to ember-cli v2.13-beta.3 to test and have also run into this issue.

yarn: v0.23.2
node: v6.10.1 (alto tested with with same issue on v4.8.1)

rm -rf node_modules && yarn install made no difference

If there's any other info I can provide to help track the issue down please let me know. My test branch is here if it's of any use

@Turbo87
Copy link
Member

Turbo87 commented Apr 21, 2017

result of git bisect looks a little confusing to me... 🤔

fddbc4a111bb2ec57170e2648a5fc37e2036c422 is the first bad commit
commit fddbc4a111bb2ec57170e2648a5fc37e2036c422
Author: Tobias Bieniek <tobias.bieniek@gmail.com>
Date:   Thu Mar 16 13:00:23 2017 +0100

    Release v2.13.0-beta.1

@rwjblue
Copy link
Member

rwjblue commented Apr 21, 2017

Submitted the fix in #190

@simonexmachina
Copy link
Author

Thanks @rwjblue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants