emberjs / ember-test-helpers

Test-framework-agnostic helpers for testing Ember.js applications
Apache License 2.0
187 stars 257 forks source link

Expected Broccoli node, got undefined for inputNodes[0] #1048

Closed Turbo87 closed 3 years ago

Turbo87 commented 3 years ago

After upgrading from 2.2.6 to 2.2.7 we see the following build failure (regular build, no embroider):

TypeError: broccoli-persistent-filter:Babel > [Babel: @ember/test-helpers] (Babel: @ember/test-helpers): Expected Broccoli node, got undefined for inputNodes[0]
    at Babel.Plugin (/builds/qonto/qonto-js/node_modules/broccoli-plugin/index.js:23:13)
    at Babel.Filter [as constructor] (/builds/qonto/qonto-js/node_modules/broccoli-persistent-filter/index.js:87:10)
    at new Babel (/builds/qonto/qonto-js/node_modules/broccoli-babel-transpiler/index.js:58:10)
    at Class.transpileTree (/builds/qonto/qonto-js/node_modules/ember-cli-babel/index.js:169:16)
    at Class.treeForVendor (/builds/qonto/qonto-js/node_modules/@ember/test-helpers/index.js:44:43)
    at Class._treeFor (/builds/qonto/qonto-js/node_modules/ember-cli/lib/models/addon.js:668:33)
    at Class.treeFor (/builds/qonto/qonto-js/node_modules/ember-cli/lib/models/addon.js:628:21)
    at /builds/qonto/qonto-js/node_modules/ember-cli/lib/broccoli/ember-app.js:697:26
    at Array.reduce (<anonymous>:null:null)
    at EmberApp._addonTreesFor (/builds/qonto/qonto-js/node_modules/ember-cli/lib/broccoli/ember-app.js:695:32)
    at EmberApp.addonTreesFor (/builds/qonto/qonto-js/node_modules/ember-cli/lib/broccoli/ember-app.js:719:17)
    at EmberApp.getExternalTree (/builds/qonto/qonto-js/node_modules/ember-cli/lib/broccoli/ember-app.js:1177:30)
    at EmberApp.toArray (/builds/qonto/qonto-js/node_modules/ember-cli/lib/broccoli/ember-app.js:1540:12)
    at EmberApp.toTree (/builds/qonto/qonto-js/node_modules/ember-cli/lib/broccoli/ember-app.js:1644:36)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/ember-cli-mirage/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/ember-exam/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at EmberApp.appInstance.toTree (/builds/qonto/qonto-js/node_modules/ember-classic-decorator/node_modules/@embroider/macros/src/ember-addon-main.js:48:35)
    at module.exports (/builds/qonto/qonto-js/ember-cli-build.js:142:14)
    at Builder.readBuildFile (/builds/qonto/qonto-js/node_modules/ember-cli/lib/models/builder.js:49:14)
    at Builder.setupBroccoliBuilder (/builds/qonto/qonto-js/node_modules/ember-cli/lib/models/builder.js:63:22)
    at new Builder (/builds/qonto/qonto-js/node_modules/ember-cli/lib/models/builder.js:29:10)
    at BuildTask.run (/builds/qonto/qonto-js/node_modules/ember-cli/lib/tasks/build.js:13:19)
    at /builds/qonto/qonto-js/node_modules/ember-cli/lib/models/command.js:238:24
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Class.run (/builds/qonto/qonto-js/node_modules/ember-cli/lib/commands/test.js:197:7)
    at /builds/qonto/qonto-js/node_modules/ember-cli/lib/cli/cli.js:204:32
    at CLI.run (/builds/qonto/qonto-js/node_modules/ember-cli/lib/cli/cli.js:251:14)
    at module.exports (/builds/qonto/qonto-js/node_modules/ember-cli/lib/cli/index.js:145:12)

/cc @rwjblue @stefanpenner

Turbo87 commented 3 years ago

https://github.com/rust-lang/crates.io/pull/3709 can be used for reproduction

simonihmig commented 3 years ago

Same here.

It seems is rawVendorTree is undefined here.

And indeed, looking at the addon in node_modules, there is no /vendor folder, although it exists in the repo: image

simonihmig commented 3 years ago

PR: #1049

rwjblue commented 3 years ago

Closed by #1049 and #1050

rwjblue commented 3 years ago

Trying to figure out why CI was happy when I merged the original change, I think its because we have a vendor/.gitkeep file but those aren't published.

rwjblue commented 3 years ago

Created https://github.com/emberjs/ember-test-helpers/pull/1051 to replicate that failure, just to prove that is the root cause.

rwjblue commented 3 years ago

OK, that confirmed it. Removing the vendor/.gitkeep causes the same failure that we saw "in reality".

snewcomer commented 2 years ago

Also seeing this error. However, it is a bit general across a few projects. ember-string, ember-test-helpers and ember-legacy-built-in-components.

https://github.com/emberjs/ember.js/runs/4201740552?check_suite_focus=true

PR - https://github.com/emberjs/ember.js/pull/19728

snewcomer commented 2 years ago

Actually for some reason I just had to include the download artifact. šŸ¤·