ember.js
ember.js copied to clipboard
[Bug] Some addons fail ember:try scenarios with ember-release (3.25) with loc$$1.sliceStartChars is not a function
🐞 Describe the Bug
Test fail because as of this writing loc$$1.sliceStartChars is not a function
. Going deeper
🔬 Minimal Reproduction
This pull request shows the error https://github.com/adopted-ember-addons/ember-light-table/pull/685
😕 Actual Behavior
Going deeper into the stack
🤔 Expected Behavior
It passes tests like all versions before and after ember-source 3.25
➕ Additional Context
Full stack trace:
- broccoliBuilderErrorStack: TypeError: loc$$1.sliceStartChars is not a function
at ElementNormalizer.classifyTag (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14700:32)
at ElementNormalizer.ElementNode (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14510:23)
at StatementNormalizer.normalize (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14361:52)
at /home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14088:25
at Array.map (<anonymous>)
at normalize (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14087:67)
at precompileJSON (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:6070:44)
at precompile (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:6110:27)
at Object.precompile (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:20344:37)
at Object.template (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-font-awesome/node_modules/ember-cli-htmlbars/utils.js:29:40)
- code: [undefined]
- codeFrame: loc$$1.sliceStartChars is not a function
- errorMessage: ember-font-awesome/components/fa-icon/template.hbs: loc$$1.sliceStartChars is not a function
in /tmp/broccoli-6377QHsgFLGoZe2W/out-221-funnel_funnel_ember_font_awesome_addon
at broccoli-persistent-filter:TemplateCompiler
- errorType: Template Compiler Error
- location:
- column: [undefined]
- file: ember-font-awesome/components/fa-icon/template.hbs
- line: [undefined]
- treeDir: /tmp/broccoli-6377QHsgFLGoZe2W/out-221-funnel_funnel_ember_font_awesome_addon
- message: ember-font-awesome/components/fa-icon/template.hbs: loc$$1.sliceStartChars is not a function
in /tmp/broccoli-6377QHsgFLGoZe2W/out-221-funnel_funnel_ember_font_awesome_addon
at broccoli-persistent-filter:TemplateCompiler
- name: Error
- nodeAnnotation: [undefined]
- nodeName: broccoli-persistent-filter:TemplateCompiler
- originalErrorMessage: loc$$1.sliceStartChars is not a function
- stack: TypeError: loc$$1.sliceStartChars is not a function
at ElementNormalizer.classifyTag (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14700:32)
at ElementNormalizer.ElementNode (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14510:23)
at StatementNormalizer.normalize (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14361:52)
at /home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14088:25
at Array.map (<anonymous>)
at normalize (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:14087:67)
at precompileJSON (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:6070:44)
at precompile (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:6110:27)
at Object.precompile (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-source/dist/ember-template-compiler.js:20344:37)
at Object.template (/home/travis/build/adopted-ember-addons/ember-light-table/node_modules/ember-font-awesome/node_modules/ember-cli-htmlbars/utils.js:29:40)
@rwjblue let me know if you need anything else. As a reminder, more code searching only finds the function sliceStartChars
in glimmer
I think this is due to
https://github.com/cibernox/ember-ast-helpers/blob/4022ed036228e4210438b37fea3c4ed78420036e/lib/build-time-component.ts#L306
syntax.builders.element
doesn't support that style of invocation, it is implemented here:
https://github.com/glimmerjs/glimmer-vm/blob/ddb199a88d0ab82e8ac914d3d349c8f2815d462f/packages/%40glimmer/syntax/lib/v1/public-builders.ts#L196-L205
The builders.element
method used to support that style of invocation, this is the implementation as of Ember 3.24
https://github.com/glimmerjs/glimmer-vm/blob/v0.65.2/packages/@glimmer/syntax/lib/builders.ts#L274-L339
Since these builders are all private API anyways (and we have a few other significant regression issues to deal with), I doubt I'll have the time to dig in and fix it myself. I do think the easiest fix is to update the ember-ast-helpers to use the new syntax, but if someone has the time to make a PR to glimmerjs/glimmer-vm to support the older syntax I'm happy to review + land + back port.
@rwjblue I'm only taking a quick glance here (as my son uses me as a human jungle gym) and it looks like this is a easy as transferring the old invocation code to the the most up to date code. Am I in the ball park? If so I can make some time to knock this out.
it looks like this is a easy as transferring the old invocation code to the the most up to date code. Am I in the ball park?
Ya, that is definitely possible.
@rwjblue I'm only taking a quick glance here (as my son uses me as a human jungle gym) and it looks like this is a easy as transferring the old invocation code to the the most up to date code. Am I in the ball park? If so I can make some time to knock this out.
Would be really cool if you can do that. The app on 3.25.3
just refuses to start because of that.
same problem with ember-font-awesome
FWIW - I can't build an ember project that uses ember-font-awesome
with any version after 3.20. I get loc$$1.sliceStartChars is not a function
when I use ember b
after upgrading the project using ember-cli-update --to 3.21
(or 3.22, 3.23, 3.24, or 3.25).
@trevordevore The fix on ember-ast-helpers, to something like this:
return this.syntax.builders.element(this.tagName, {attrs: this.elementAttrs, modifiers: this.elementModifiers, children: this.elementChildren});
It works! - but you will get another "cant find length on undefined" somewhere else (because some node
variable wont have a type
property, etc). So, it seems a more comprehensive fix is needed.
Thanks for the info @liancastellon. I ended up removing ember-font-awesome
from my app and it is now building with Ember 3.25.
Any updates on this?
May I know any updates on this?
I have an Ember 3.28.1 project with "ember-font-awesome": "^4.0.0-rc.4"
, and the ember s
failed with the trace containing:
Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in ember-font-awesome/components/fa-icon/template.hbs
loc$$1.sliceStartChars is not a function
Any workarounds? Getting the same issue with ember-popper...
Getting this error in Ember 3.28.8.
error.dump.1894159c13b509344c3566a5fdd1b364.log
trying to upgrade from 3.24 to 3.28.8 and ran into the same error.
WIP on branch: https://github.com/puzzle/cryptopus/tree/ember-3.28-upgrade
any news on how to fix this?
I think ember-popper is creating this issue
Any update on this issue, as more of us start having it when upgrading to 3.28 ?
Any workarounds? Getting the same issue with ember-popper...
@skaverg which version of ember popper are you using? For me, this error was from a package called 'ember-attacher' which used an older version of the ember popper, when updated the ember-attacher to 1.3.0 (which is the latest version), it worked for me (I was upgrading ember-cli from 3.20 to 3.28). It updated the ember-popper to 0.11.3. You may try this.
Thanks everyone for the pointers. If it helps others:
We are working on upgrading ember little by little. Same as @sunn2407 : ember-cli 3.20.3 --> 3.28.6. We use ember-bootstrap heavily which was depending on a previous version of ember-popper (use npm list ember-popper
to see where the dep is comming from). By moving ember-bootstrap to 4.9.0 (and forcing the bootstrapVersion to 3), I was able to bring ember-popper to v0.11.3 and eradicate the mentioned error.