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
TemplateCompiler cannot read property 'visitor' of undefined
#19724
Comments
It appears the deprecated Now it seems pretty reasonable that a deprecated plugin causes a failure, but it isn't clear yet if this effects non-deprecated plugins, and also the debugging of this wasn't ideal. I'll dig in some more.. |
Ok. Solution: Ensure your template compiler plugins follow the new form only. In my case, ember-cli-template-lint's plugins where simply incompatible with the new plugin form introduced by glimmerjs/glimmer-vm@28652d4, and required upgrading to That being said, the debugging on this is quite sub-optimal, and I although I hope folks running into this problem at helped by this issue, i suspect (assuming the above is a reasonable change) that better detection of the failure mode could go a long way. Specifically https://github.com/glimmerjs/glimmer-vm/blob/ef92c497c3d921af22b38a54eac1445c204c3370/packages/%40glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L447 could detect a return value without |
@stefanpenner thank you for the write-up; I will be fixing a bunch of addons with this issue over the next few weeks, I expect. I’ll report them here as I find them so that the community has a resource to know what to update! ConfirmedFixed
Not yet fixedSooner™ Unconfirmed |
Hey @stefanpenner im trying to upgrade our app and keep getting this error with no helpful stack trace and error report. Any suggestions on what I should do next? Here is the error report (with removed app name and source):
|
@npendery could you please check if you still have |
@SergeAstapov no |
@npendery I've seen this issue multiple times and various projects/addons and it always was resolved with Couple things come to my mind:
hope it helps! |
@SergeAstapov I tried all of that (as well as If you think of anything else, im all ears. Thanks for the feedback, really appreciate it! |
@stefanpenner I am facing this same issue too when trying to upgrade from 3.28 to 4. I replaced ember-cli-template-lint with ember-template-lint and made sure the htmlbars version I have as a direct dependency is the latest. Howewer, I do have dependencies relying on an older version of htmlbars and am not sure if that's the issue. All the direct dependencies am using have been upgraded to their corresponding latest versions ├─┬ @ember/test-helpers@2.6.0 |
@npendery I finally managed to figure out what was causing the ember 4 build to fail for me. Due to some reason, using ember-cp-validations library was breaking the code. Removing it and all related code helped the build to succeed. Need to go back and figure out how to get around the problem. Just wanted to give you a heads up in case you are using this library. |
In general, you should start by identifying any dependencies who in turn depend on old versions of ember-cli-htmlbars (or its predecessors) and either upgrade your dependencies to versions which have newer dependencies, or go open PRs which do the upgrade on the dependencies' dependencies (DEPENDENCIEEEEES) to get them up to date. That may not fix it immediately, but it's likely to help. |
@chriskrycho I did that too. I removed libraries and associated code where the htmlbars version was not > 5.x.x. That did not help. The ember-cp-validations library I pulled out does not have any dependency on ember-cli-htmlbars or ember-cli-template-lint. But removing that helped in the build. Am not sure why yet. |
Great, thanks @JenLyndle! Ill look into why that helps too |
To make sure that my other dependencies were not causing this, I created a brand new ember application and installed ember-cp-validations. I ran ember build then and got the following deprecation and error: WARNING: [DEPRECATION] [DEPRECATION] Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead. See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details. Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. The following steps may help:
ImportantIn order to avoid repeatedly showing the same deprecation messages, no further deprecation messages will be shown for usages of the Ember Global until ember-cli-babel is upgraded to v7.26.6 or above. To see all instances of this deprecation message, set the DetailsPrior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, potentially triggering this deprecation message indirectly, even when you did not observe these deprecated usages in your code. The following outdated versions are found in your project:
Environment: development Cannot read properties of undefined (reading 'visitor') Stack Trace and Error Report: /var/folders/7l/54hcgmcj5px90x_b3n2lkss00000gn/T/error.dump.230e7976d87f3c46c3e6cfa1b4b3edcb.log |
@JenLyndle The issue with |
I'm currently diagnosing an issue that cropped up with the recent ember-canary/ember-beta's (todays), it may not be a bug with Ember.js itself, but rather some other part of our default system that is now getting tripped up.
Stack Strace:
The text was updated successfully, but these errors were encountered: