ember-basic-dropdown icon indicating copy to clipboard operation
ember-basic-dropdown copied to clipboard

Ember Canary: Cannot read property 'start' of undefined

Open jherdman opened this issue 3 years ago • 19 comments

I'm seeing the following error when building against Ember Canary:

Template Compiler Error (TemplateCompiler) in ember-basic-dropdown/templates/components/basic-dropdown-content.hbs

Cannot read property 'start' of undefined

Contents of the log file:

ERROR Summary:

  - broccoliBuilderErrorStack: TypeError: Cannot read property 'start' of undefined
    at Source.spanFor (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:8013:26)
    at BlockContext.loc (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:12810:26)
    at ElementNormalizer.ElementNode (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13189:29)
    at StatementNormalizer.normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13047:52)
    at /home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13214:27
    at Array.map (<anonymous>)
    at ElementNormalizer.ElementNode (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13213:41)
    at StatementNormalizer.normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13047:52)
    at /home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13148:27
    at Array.map (<anonymous>)
    at StatementNormalizer.Block (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13147:61)
    at StatementNormalizer.BlockStatement (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13136:23)
    at StatementNormalizer.normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13044:23)
    at /home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:12783:25
    at Array.map (<anonymous>)
    at normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:12782:62)
  - code: [undefined]
  - codeFrame: Cannot read property 'start' of undefined
  - errorMessage: ember-basic-dropdown/templates/components/basic-dropdown-content.hbs: Cannot read property 'start' of undefined
        in /run/user/1000/broccoli-120533pyvyQF6CFynn/out-204-colocated_template_processor
        at TemplateCompiler
  - errorType: Template Compiler Error
  - location:
    - column: [undefined]
    - file: ember-basic-dropdown/templates/components/basic-dropdown-content.hbs
    - line: [undefined]
    - treeDir: /run/user/1000/broccoli-120533pyvyQF6CFynn/out-204-colocated_template_processor
  - message: ember-basic-dropdown/templates/components/basic-dropdown-content.hbs: Cannot read property 'start' of undefined
        in /run/user/1000/broccoli-120533pyvyQF6CFynn/out-204-colocated_template_processor
        at TemplateCompiler
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: TemplateCompiler
  - originalErrorMessage: Cannot read property 'start' of undefined
  - stack: TypeError: Cannot read property 'start' of undefined
    at Source.spanFor (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:8013:26)
    at BlockContext.loc (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:12810:26)
    at ElementNormalizer.ElementNode (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13189:29)
    at StatementNormalizer.normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13047:52)
    at /home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13214:27
    at Array.map (<anonymous>)
    at ElementNormalizer.ElementNode (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13213:41)
    at StatementNormalizer.normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13047:52)
    at /home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13148:27
    at Array.map (<anonymous>)
    at StatementNormalizer.Block (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13147:61)
    at StatementNormalizer.BlockStatement (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13136:23)
    at StatementNormalizer.normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:13044:23)
    at /home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:12783:25
    at Array.map (<anonymous>)
    at normalize (/home/james/DEV/PN/fullscreen-card-renderer/node_modules/ember-source/dist/ember-template-compiler.js:12782:62)

jherdman avatar Nov 18 '20 14:11 jherdman

Looking at the related PR, this should be fixed, can you confirm?

cibernox avatar Nov 21 '20 23:11 cibernox

Assuming that this change has landed in Ember Canary, sadly, no... I'll try again in a few days to see what happens.

jherdman avatar Nov 24 '20 17:11 jherdman

FYI tried again today and still no luck.

jherdman avatar Nov 28 '20 14:11 jherdman

I just realized I'm having a bit of a brain fart on the matter. I'm using this addon via ember-power-calednar. I'll put together a PR to update that addon and go from there.

jherdman avatar Nov 28 '20 15:11 jherdman

I'm receiving a similar error with Ember 3.25.0 except it's complaining about type instead of start.

Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in ember-basic-dropdown/templates/components/basic-dropdown-content.hbs

Cannot read property 'type' of undefined


Stack Trace and Error Report: /var/folders/_8/c8x5jpjn3m128c2k47kwrr8h0000gn/T/error.dump.3db35b8594d4b728eb37249ef57933fc.log

csprocket777 avatar Feb 16 '21 20:02 csprocket777

@csprocket777 what version of ember-basic-dropdown and ember-maybe-in-element do you have? I think you need at least 3.0.8 so that you get https://github.com/cibernox/ember-basic-dropdown/commit/e89a00e0dbdd1226bf6732b8500a3df62097a25d

jamescdavis avatar Feb 16 '21 21:02 jamescdavis

@jamescdavis I'm using ember-power-select which has a dependency on 3.0.11 of ember-basic-dropdown. Do I need to include ember-maybe-in-element separately? In my node-modules folder it's including 3.0.12 of ember-basic-dropdown

csprocket777 avatar Feb 16 '21 21:02 csprocket777

You shouldn't have to (it's already a dep of ember-basic-dropdown). It's possible something regressed since https://github.com/glimmerjs/glimmer-vm/pull/1204

jamescdavis avatar Feb 16 '21 21:02 jamescdavis

🤔 ember try:one ember-release fails for me locally. AFAICT CI is not actually running for this repo.

jamescdavis avatar Feb 16 '21 21:02 jamescdavis

@jamescdavis Well right now my build isn't completing and I'm stuck here:

Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in ember-basic-dropdown/templates/components/basic-dropdown-content.hbs

Cannot read property 'type' of undefined


Stack Trace and Error Report: /var/folders/_8/c8x5jpjn3m128c2k47kwrr8h0000gn/T/error.dump.a3fd85eb2dcb765a630106a34740190d.log
(node:3650) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined
    at BlockContext.isFreeVar (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14150:25)
    at BlockContext.isFreeVar (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14156:21)
    at BlockContext.resolutionFor (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14127:16)
    at StatementNormalizer.BlockStatement (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14441:35)
    at StatementNormalizer.normalize (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14358:23)
    at /Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14462:27
    at Array.map (<anonymous>)
    at StatementNormalizer.Block (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14461:61)
    at StatementNormalizer.BlockStatement (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14450:23)
    at StatementNormalizer.normalize (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14358:23)
    at /Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14462:27
    at Array.map (<anonymous>)
    at StatementNormalizer.Block (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14461:61)
    at StatementNormalizer.BlockStatement (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14451:33)
    at StatementNormalizer.normalize (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14358:23)
    at /Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14528:27
    at Array.map (<anonymous>)
    at ElementNormalizer.ElementNode (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14527:41)
    at StatementNormalizer.normalize (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14361:52)
    at /Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14462:27
    at Array.map (<anonymous>)
    at StatementNormalizer.Block (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14461:61)
    at StatementNormalizer.BlockStatement (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14450:23)
    at StatementNormalizer.normalize (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14358:23)
    at /Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14088:25
    at Array.map (<anonymous>)
    at normalize (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:14087:67)
    at precompileJSON (/Users/[obscured]/Documents/[obscured, ember-project-path]/node_modules/ember-source/dist/ember-template-compiler.js:6070:44)
(Use `node --trace-warnings ...` to show where the warning was created)

csprocket777 avatar Feb 16 '21 21:02 csprocket777

I am seeing the same, but with ember-basic-dropdown 1.x (can't upgrade to latest because our app is on Ember 3.12 and can't upgrade just yet).

jamescdavis avatar Feb 16 '21 21:02 jamescdavis

Ok, there was some issue with ember-font-awesome in the test suite. I removed it and the {{fa-icon}} invocations in tests and the test suite builds and runs on ember-release (3.25). One test does fail, but I'm not getting the build errors. Not sure what's going on here...

jamescdavis avatar Feb 16 '21 22:02 jamescdavis

I actually removed ember-font-awesome just recently in favor of @fortawesome/ember-fontawesome.... I can't remove this or it's usage in my app.

csprocket777 avatar Feb 16 '21 22:02 csprocket777

Ok I've solved my specific issue. @jamescdavis, you're right, the latest versions of the ember-power-select and ember-basic-dropdown components do come with the proper versions of ember-maybe-in-element. Even explicitly including the proper version in my package.json didn't resolve it for me.

So I decided to check which versions were being used in my project:

npm ls ember-maybe-in-element
├── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]  deduped
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected]

Notice ember-power-select-typeahead is using the old-n-busted version.

So I added a resolution to my package.json file and it ensured I was using the proper version across the all the addons. My compile no longer complains about this particular issue.

csprocket777 avatar Feb 17 '21 14:02 csprocket777

Sorry for neglecting this for so long, I'm super busy and try to concentrate my OS work on Fridays. Glad @csprocket777 found the issue.

I'm going to migrate to github actions to fix CI.

cibernox avatar Feb 19 '21 19:02 cibernox

Ok, it took a while but I've setup github actions and fixed the test suite for beta and canary.

It turns out I had @embroider/util pinned to an old version and that was the source of some of the failures. I've released a new patch version in which I allow that dependency to float.

Perhaps that fixes the problems some of you have experienced?

cibernox avatar Feb 20 '21 01:02 cibernox

Thank you for taking the time to get CI going again, @cibernox!

jamescdavis avatar Feb 20 '21 13:02 jamescdavis

I'm experiencing the same issue Cannot read property 'type' of undefined when building with: ember-power-select 3.0.4 ember 3.26

ballPointPenguin avatar Jun 17 '21 23:06 ballPointPenguin

'type' of undefined issue fixed in https://github.com/cibernox/ember-power-select-typeahead/pull/114 - published to 0.8.2 for those running into this issue with typeahead

linearza avatar Nov 17 '21 15:11 linearza