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

[Bug] Some addons fail ember:try scenarios with ember-release (3.25) with loc$$1.sliceStartChars is not a function #19432

Open
tylerturdenpants opened this issue Feb 26, 2021 · 19 comments

Comments

@tylerturdenpants
Copy link
Member

🐞 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
adopted-ember-addons/ember-light-table#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)
@tylerturdenpants
Copy link
Member Author

tylerturdenpants commented Feb 26, 2021

@rwjblue let me know if you need anything else. As a reminder, more code searching only finds the function sliceStartChars in glimmer

@rwjblue
Copy link
Member

rwjblue commented Feb 28, 2021

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

@rwjblue
Copy link
Member

rwjblue commented Feb 28, 2021

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.

@tylerturdenpants
Copy link
Member Author

@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.

@rwjblue
Copy link
Member

rwjblue commented Mar 2, 2021

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.

@stfnio
Copy link

stfnio commented Mar 22, 2021

@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.

@Hujun
Copy link

Hujun commented Mar 23, 2021

same problem with ember-font-awesome

@trevordevore
Copy link

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).

@liancastellon
Copy link

@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.

@trevordevore
Copy link

Thanks for the info @liancastellon. I ended up removing ember-font-awesome from my app and it is now building with Ember 3.25.

@sovietspaceship2
Copy link

Any updates on this?

@waihon
Copy link

waihon commented Nov 8, 2021

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

@skaverg
Copy link

skaverg commented Dec 6, 2021

Any workarounds? Getting the same issue with ember-popper...

@neilthawani
Copy link

Getting this error in Ember 3.28.8.

@mtnstar
Copy link

mtnstar commented Feb 3, 2022

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

@viganella
Copy link

viganella commented Feb 9, 2022

Any update on this issue, as more of us start having it when upgrading to 3.28 ?

@sunn2407
Copy link

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.

@AL1077609
Copy link

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.

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

No branches or pull requests