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

Update breaks Ember builds for Ember 3.7 #197

Closed
Redsandro opened this issue Nov 23, 2019 · 21 comments
Closed

Update breaks Ember builds for Ember 3.7 #197

Redsandro opened this issue Nov 23, 2019 · 21 comments
Labels

Comments

@Redsandro
Copy link

Redsandro commented Nov 23, 2019

I can't provide a range of versions so I don't know up until which version this error occurs, but for Ember 3.7 you'll need ember-math-helpers <= 2.10.0.

Ember installations with ember-math-helpers in package.json configured as ^2.10.0 will break when doing a fresh npm install.

Build Error (broccoli-persistent-filter:Babel > [Babel: ember-math-helpers]) in ember-math-helpers/helpers/abs.js

Cannot read property 'getHash' of null
@Redsandro Redsandro changed the title Update breaks Ember builds Update breaks Ember builds for Ember 3.7 Nov 23, 2019
@RobbieTheWagner
Copy link
Owner

@Redsandro the tests are passing back to Ember 3.4 https://travis-ci.org/shipshapecode/ember-math-helpers, so I think there may be more at play here and/or there is something about 3.7 specifically that doesn't work.

@Redsandro
Copy link
Author

@rwwagner90 Possibly. I can't figure out why this is happening though. Does the message "Cannot read property 'getHash' of null" ember-math-helpers/helpers/abs.js give you any idea about where I should be looking?

@RobbieTheWagner
Copy link
Owner

It does not. There is nothing in https://github.com/shipshapecode/ember-math-helpers/blob/master/addon/helpers/abs.js that uses anything called getHash. Is it possible to get a small, isolated reproduction we could look at? It's also possible there was a bug in Ember itself in 3.7. Would you be able to use 3.8?

@Redsandro
Copy link
Author

Sorry for not getting back to you earlier. I was traveling. This is definitely still an issue and it's weird that I can get it to work by downgrading ember-math-helpers.

I'm a long time Linux user, but Ember feels a bit like Windows in the old days, where over time, updates cause more and more inexplicable errors to the point of needing a fresh install.

With Ember Octane out, I think it might be time to do a 'fresh install'.

I will close this issue for now.

@RobbieTheWagner
Copy link
Owner

@Redsandro if you can reproduce in a small, self contained, app, let me know.

@iamareebjamal
Copy link

iamareebjamal commented Jan 28, 2020

Happening for us as well

ERROR Summary:

  - broccoliBuilderErrorStack: TypeError: Cannot read property 'getHash' of null
    at hashForDep (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/hash-for-dep/index.js:67:24)
    at optionsHash (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/lib/options-hash.js:58:51)
    at Babel.optionsHash (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/index.js:117:26)
    at Babel.cacheKeyProcessString (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/index.js:124:15)
    at Object.processString (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/broccoli-persistent-filter/lib/strategies/persistent.js:30:19)
    at Processor.processString (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/broccoli-persistent-filter/lib/processor.js:19:27)
    at /home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/broccoli-persistent-filter/index.js:353:16
    at initializePromise (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/broccoli-persistent-filter/node_modules/rsvp/dist/rsvp.js:520:5)
    at new Promise (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/broccoli-persistent-filter/node_modules/rsvp/dist/rsvp.js:995:33)
    at invoke (/home/iamareebjamal/git/open-event-frontend/node_modules/broccoli-babel-transpiler/node_modules/broccoli-persistent-filter/index.js:352:10)
  - code: [undefined]
  - codeFrame: Cannot read property 'getHash' of null
  - errorMessage: ember-math-helpers/helpers/abs.js: Cannot read property 'getHash' of null
        in /tmp/broccoli-27396gIn7cjRKlxLh/out-457-funnel_funnel_addon_js
        at broccoli-persistent-filter:Babel > [Babel: ember-math-helpers] (Babel: ember-math-helpers)
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: ember-math-helpers/helpers/abs.js
    - line: [undefined]
    - treeDir: /tmp/broccoli-27396gIn7cjRKlxLh/out-457-funnel_funnel_addon_js
  - message: ember-math-helpers/helpers/abs.js: Cannot read property 'getHash' of null
        in /tmp/broccoli-27396gIn7cjRKlxLh/out-457-funnel_funnel_addon_js
        at broccoli-persistent-filter:Babel > [Babel: ember-math-helpers] (Babel: ember-math-helpers)
  - name: BuildError
  - nodeAnnotation: Babel: ember-math-helpers
  - nodeName: broccoli-persistent-filter:Babel > [Babel: ember-math-helpers]
  - originalErrorMessage: Cannot read property 'getHash' of null

@RobbieTheWagner
Copy link
Owner

@iamareebjamal can you provide any details? Ember version, ember-cli version, custom broccoli stuff you might be doing, etc?

@iamareebjamal
Copy link

"ember-cli": "~3.10.1"

Using broccoli-persistent-filter

The project is open source. This is the PR - fossasia/open-event-frontend#3873

@Redsandro Redsandro reopened this Jan 28, 2020
@RobbieTheWagner
Copy link
Owner

My guess would be something with broccoli, babel, or the htmlbars update, but I don't really know. I've been using it without any issues in several projects. It might be that you are using broccoli-funnel and this addon is not compatible with the version or something. @Redsandro thoughts?

@Redsandro
Copy link
Author

One guess is that a certain dependency is too new. But I'm grasping straws, I couldn't figure it out.

v2.10.0...v2.11.0 see package.json

@iamareebjamal
Copy link

It's working for 2.11.1 for us. Breaking on latest

@iamareebjamal
Copy link

Starts breaking from 2.11.2

@RobbieTheWagner
Copy link
Owner

@iamareebjamal no real changes between those two versions, except maybe ember-cli-babel version v2.11.1...v2.11.2#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R32

Unless you are perhaps using node older than 8.x? We did drop support for node 6 there.

@iamareebjamal
Copy link

Node 12. There are other dependency updates as well. But yes, no such code change. Nevertheless, for some reason, babel can't find this module for hashing

@Redsandro
Copy link
Author

Is it relevant that

  • I was using Ember 3.7 and the update broke when emh updated dependency ember-source from 3.7 to 3.9
  • @iamareebjamal was using Ember 3.10 and emh 2.11.1 had dependency ember-source 3.9 updated to 3.15 in latest?

Perhaps ember-source used breaks compatibility with older versions of Ember?

@RobbieTheWagner
Copy link
Owner

@Redsandro no ember-source is a devDep and does not get shipped.

@Redsandro
Copy link
Author

Yeah makes sense. It's puzzling.

So this issue is now confirmed, but it's hard to figure out why it is occurring. It could very well be an upstream issue, but so far the only plugin that I encountered needed special care (trial and error) when upgrading was ember-math-helper. Because the usual problem for other plugins is the other way around: newer Ember version might break them.

I figured it was easiest to reinstall a fresh copy of everything without upgrading for my app and then copy over the relevant files (and edit where necessary).

@RobbieTheWagner
Copy link
Owner

It's likely the custom whitelist / blacklist stuff we provide, so you don't have to ship all the helpers. That's the only thing different than any standard addon. I mostly copied it from here https://github.com/DockYard/ember-composable-helpers/blob/master/index.js so maybe we should update things to match theirs more closely and see if it helps.

@RobbieTheWagner
Copy link
Owner

Can you guys try 2.13.0 and see if anything is different?

@iamareebjamal
Copy link

When we upgraded rest of our dependencies, including the handlebars one, it automatically started working for us, the previous version as well. Unfortunately, that was a busy week and we couldn't notice exactly which dependency upgrade fixed it

@Redsandro
Copy link
Author

Redsandro commented Feb 9, 2020

2.13.0 works for me on a different app. I am not be able to check the exact same app with the exact same dependencies that had the issue in the fist place, because that one had since been upgraded from Ember 3.7.

Thank you again @rwwagner90 for looking into this.

Update

Nope, 2.13.0 does not fix the issue. In my last active Ember 3.7 project, I still cannot use any ember-math-helpers newer than 2.10.0.

  - broccoliBuilderErrorStack: TypeError: Cannot read property 'getHash' of null
    at hashForDep (/app/node_modules/hash-for-dep/index.js:67:24)
    at optionsHash (/app/node_modules/ember-math-helpers/node_modules/broccoli-babel-transpiler/lib/options-hash.js:58:51)
    at Babel.optionsHash (/app/node_modules/ember-math-helpers/node_modules/broccoli-babel-transpiler/index.js:117:26)
    at Babel.cacheKeyProcessString (/app/node_modules/ember-math-helpers/node_modules/broccoli-babel-transpiler/index.js:124:15)
    at Object.processString (/app/node_modules/ember-math-helpers/node_modules/broccoli-persistent-filter/lib/strategies/persistent.js:41:19)
    at Processor.processString (/app/node_modules/ember-math-helpers/node_modules/broccoli-persistent-filter/lib/processor.js:24:27)
    at resolve (/app/node_modules/ember-math-helpers/node_modules/broccoli-persistent-filter/index.js:433:16)
    at initializePromise (/app/node_modules/ember-math-helpers/node_modules/rsvp/dist/rsvp.js:523:7)
    at new Promise (/app/node_modules/ember-math-helpers/node_modules/rsvp/dist/rsvp.js:1017:35)
    at invoke (/app/node_modules/ember-math-helpers/node_modules/broccoli-persistent-filter/index.js:432:10)
  - code: [undefined]
  - codeFrame: Cannot read property 'getHash' of null
  - errorMessage: ember-math-helpers/helpers/abs.js: Cannot read property 'getHash' of null
        in /tmp/broccoli-1VWbDff2DKDZK/out-265-funnel_funnel_addon_js
        at broccoli-persistent-filter:Babel > [Babel: ember-math-helpers] (Babel: ember-math-helpers)
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: ember-math-helpers/helpers/abs.js
    - line: [undefined]
    - treeDir: /tmp/broccoli-1VWbDff2DKDZK/out-265-funnel_funnel_addon_js
  - message: ember-math-helpers/helpers/abs.js: Cannot read property 'getHash' of null
        in /tmp/broccoli-1VWbDff2DKDZK/out-265-funnel_funnel_addon_js
        at broccoli-persistent-filter:Babel > [Babel: ember-math-helpers] (Babel: ember-math-helpers)
  - name: BuildError
  - nodeAnnotation: Babel: ember-math-helpers
  - nodeName: broccoli-persistent-filter:Babel > [Babel: ember-math-helpers]

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

3 participants