Skip to content

incorrectly execution of hooks where there is unresolved injected dependency #4770

Closed
@Fatme

Description

@Fatme

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: next
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime:
  • Plugin(s):

Describe the bug

To Reproduce

  1. Create new application
  2. Create hooks directory if no such
  3. Create after-prepare directory under hooks directory if no such
  4. Create hook1.js, hook2.js and hook3.js inside after-prepare directory

hook1.js

module.exports = function() {
    console.log("=================== HOOK1 ================ ");
}

hook2.js

module.exports = function ($platformsData) {
    console.log("=================== HOOK2 =================== ");
}

hook3.js

module.exports = function() {
    console.log("=================== HOOK3 ================ ");
}
  1. Execute tns prepare ios

Actual behavior
You'll see the following output:

=================== HOOK1 ================ 
after-prepare will NOT be executed because it has invalid arguments - $platformsData.

Expected behavior
You should see the following output:

=================== HOOK1 ================ 
after-prepare will NOT be executed because it has invalid arguments - $platformsData.
=================== HOOK3 ================ 

Metadata

Metadata

Assignees

Labels

bughooksDescribes issues related to hooks

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions