You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've got a really complex Ember project based on a monorepo structure. It's currently using Ember 3.12, and we're in the process of upgrading to Ember 3.16 (we only use LTS versions).
After upgrading Ember and some other unrelated / non-Ember packages, we're seeing an odd message while running linting.
The error is as follows:
AssertionError [ERR_ASSERTION]: Function should only be called on a `CallExpression` (classic class) or `ClassDeclaration` (native class)
Occurred while linting /Users/me/code/app3/packages/theapp/app/components/new-component/component.js:5
at isEmberCoreModule (/Users/me/code/app3/node_modules/eslint-plugin-ember/lib/utils/ember.js:227:5)
at isEmberObject (/Users/me/code/app3/node_modules/eslint-plugin-ember/lib/utils/ember.js:283:10)
at Property (/Users/me/code/app3/node_modules/eslint-plugin-custom-ember/lib/rules/require-super-call-on-destroy-methods.js:66:14)
at listeners.(anonymous function).forEach.listener (/Users/me/code/app3/node_modules/eslint/lib/linter/safe-emitter.js:45:58)
at Array.forEach (<anonymous>)
at Object.emit (/Users/me/code/app3/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/Users/me/code/app3/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
at NodeEventGenerator.applySelectors (/Users/me/code/app3/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
at NodeEventGenerator.enterNode (/Users/me/code/app3/node_modules/eslint/lib/linter/node-event-generator.js:297:14)
at CodePathAnalyzer.enterNode (/Users/me/code/app3/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23)
error: --------------------------------------------------------------------------
error: An uncaught YUIDoc error has occurred, stack trace given below
error: --------------------------------------------------------------------------
error: AssertionError [ERR_ASSERTION]: Function should only be called on a `CallExpression` (classic class) or `ClassDeclaration` (native class)
Occurred while linting /Users/me/code/app3/packages/theapp/app/components/new-component/component.js:5
at isEmberCoreModule (/Users/me/code/app3/node_modules/eslint-plugin-ember/lib/utils/ember.js:227:5)
at isEmberObject (/Users/me/code/app3/node_modules/eslint-plugin-ember/lib/utils/ember.js:283:10)
at Property (/Users/me/code/app3/node_modules/eslint-plugin-custom-ember/lib/rules/require-super-call-on-destroy-methods.js:66:14)
at listeners.(anonymous function).forEach.listener (/Users/me/code/app3/node_modules/eslint/lib/linter/safe-emitter.js:45:58)
at Array.forEach (<anonymous>)
at Object.emit (/Users/me/code/app3/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/Users/me/code/app3/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
at NodeEventGenerator.applySelectors (/Users/me/code/app3/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
at NodeEventGenerator.enterNode (/Users/me/code/app3/node_modules/eslint/lib/linter/node-event-generator.js:297:14)
at CodePathAnalyzer.enterNode (/Users/me/code/app3/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23)
error: --------------------------------------------------------------------------
error: Node.js version: v10.14.2
error: YUI version: 3.18.1
error: YUIDoc version: 0.10.2
error: Please file all tickets here: http://github.com/yui/yuidoc/issues
error: --------------------------------------------------------------------------
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! theapp@0.1234.0 lint:js: `eslint .`
npm ERR! Exit status 1
However, I've also tried eslint-plugin-ember8.14.0 and 9.6.0, but they both give the same error.
This seems to be a similar error to the one shown in issue #905, which is why I tried upgrading to 8.14.0 (as #905 was fixed in 8.10.1)... but all that happens is the line number in eslint-plugin-ember/lib/utils/ember.js for the isEmberCoreModule function that throws the assertion has changed. Pretty much everything else remains the same.
I've added some logging to the ember.js file in the isEmberCoreModule function, and at the time the error is thrown, I can see that the three parameters are possibly not as expected:
context logs out as a Node object, with many properties - the most salient possibly being type: 'CallExpression' (see below for the full content from logging context)
node logs out as the filename being linted (new-component/component.js, in my case)
moduleName logs out as 'EmberObject'
Given the first thing that the isEmberCoreModule function tries to do is determine the truthiness of isCallExpression(node), yet it's isCallExpression(context) that would pass that check, I'm a bit lost as to what's going on.
I've cut down both the file being linted, as well as the class it extends, to the bare minimum - but the error still persists. My components/new-component/component.js file is as follows:
As I mentioned, it's an extremely complex Ember project and there's no way I can share or upload the source. However, based on what I have provided, would anyone have an inkling what might be happening or how I might start to resolve it?
I'm happy to try any steps, and suggestions, or provide more logging if it helps.
Thanks!
The full log of what the context parameter contains is as follows:
Righty-ho, it turns out that there was an extra plugin in play that I had not spotted. Disabling that resolved the issue, so I suspect I can direct my search elsewhere.
We've got a really complex Ember project based on a monorepo structure. It's currently using Ember 3.12, and we're in the process of upgrading to Ember 3.16 (we only use LTS versions).
After upgrading Ember and some other unrelated / non-Ember packages, we're seeing an odd message while running linting.
The error is as follows:
In terms of linting packages, we're using:
However, I've also tried
eslint-plugin-ember
8.14.0
and9.6.0
, but they both give the same error.This seems to be a similar error to the one shown in issue #905, which is why I tried upgrading to
8.14.0
(as #905 was fixed in8.10.1
)... but all that happens is the line number ineslint-plugin-ember/lib/utils/ember.js
for theisEmberCoreModule
function that throws the assertion has changed. Pretty much everything else remains the same.I've added some logging to the
ember.js
file in theisEmberCoreModule
function, and at the time the error is thrown, I can see that the three parameters are possibly not as expected:context
logs out as aNode
object, with many properties - the most salient possibly beingtype: 'CallExpression'
(see below for the full content from loggingcontext
)node
logs out as the filename being linted (new-component/component.js
, in my case)moduleName
logs out as'EmberObject'
Given the first thing that the
isEmberCoreModule
function tries to do is determine the truthiness ofisCallExpression(node)
, yet it'sisCallExpression(context)
that would pass that check, I'm a bit lost as to what's going on.I've cut down both the file being linted, as well as the class it extends, to the bare minimum - but the error still persists. My
components/new-component/component.js
file is as follows:And my
components/base-component/component.js
file is just as bare:As I mentioned, it's an extremely complex Ember project and there's no way I can share or upload the source. However, based on what I have provided, would anyone have an inkling what might be happening or how I might start to resolve it?
I'm happy to try any steps, and suggestions, or provide more logging if it helps.
Thanks!
The full log of what the
context
parameter contains is as follows:The text was updated successfully, but these errors were encountered: