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
I have a file with an actions hash that is kicking out this error:
2023-06-20T15:50:48.604Z ERROR: [app/controllers/authenticated/customers/index.js]
RuntimeDataError: Could not find runtime data
2023-06-20T15:50:48.613Z ERROR: [app/controllers/authenticated/customers/index.js]
ValidationError: Validation errors for class 'Index':
[actions]: Transform not supported - value is of type object. For more details: eslint-plugin-ember/avoid-leaking-state-in-ember-objects
I'm assuming that the issue is something that fixing the "Could not find runtime data" error would resolve, although it works fine if I remove the actions hash and run it without it.
I'm invoking it with: npx ember-native-class-codemod http://localhost:4202/partner/ app/controllers/authenticated/customers/index.js
And I can verify the app is loaded at http://localhost:4202/partner/
I've just come across the same issue. It seems this is because of the ignoreLeakingState option in the config. This looks like it only supports queryParams by default even though in the README it calls out queryParams and actions.
Adding actions to ignoreLeakingState options does go a step further and do a migration but in my testing it looks like it translates to actions = { ... }
@gitKrystan should actions be added as a default option in ignoreLeakingState?
Activity
DArrigoni commentedon Jun 20, 2023
After some more playing around with it I'm getting inconsistent results with this. Some times it works fine, sometimes it does not.
patocallaghan commentedon Jul 17, 2023
I've just come across the same issue. It seems this is because of the
ignoreLeakingStateoption in the config. This looks like it only supportsqueryParamsby default even though in the README it calls outqueryParamsandactions.Adding
actionstoignoreLeakingStateoptions does go a step further and do a migration but in my testing it looks like it translates toactions = { ... }@gitKrystan should
actionsbe added as a default option inignoreLeakingState?patocallaghan commentedon Jul 17, 2023
Did a bit more digging and it seems the codemod supports actions using
ObjectMethodnotation but notFunctionExpression.Works
Doesn't work
I'll see about putting together a PR
Edit:
hmm weirdly i can't replicate this behaviour in the tests
gitKrystan commentedon Jul 20, 2023
IIRC adding something to
ignoreLeakingStatemeans it won't be transformed from an object literal. Theactionshash is special-cased, as you found.Are you seeing anything about this file in codemods.log?