NativeScript / NativeScript/NativeScript
Parents expression shows [object Object] with webpack in uglify
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 1.7k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 35
Description
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: 5.4.2
- Cross-platform modules: 5.4.3
- Android Runtime: 5.4.0
- iOS Runtime: Couldn't test this on ios
- Plugin(s): NA
Describe the bug
The parent expression shows [object Object] when the project is ran with --env.uglify flag. For example following code snippet in the Label doesn't work as expected:
<span text="{{$parents['ListView']._people, $parents['ListView']._people.length }}" />
To Reproduce
- Clone git project https://github.com/rakeshgirase/ParentAabIssue.git.
- Run the program on android tns run android --env.uglify
- Please add if this is a same case on ios as well!
Expected behavior
The list should show Person 1 of 12 but it shows Person 1 of [object Object]. Following is how the resulting list looks:

Sample project
https://github.com/rakeshgirase/ParentAabIssue.git
Additional context
If you enable useLegacyWorkflow in nsconfig.json then it works fine. This issue is only in webpack.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by running the linked sample project with tns run android --env.uglify, then compare it with the useLegacyWorkflow setting in nsconfig.json. Trace the webpack/uglify path involved in evaluating the parent expression. Done means the list displays Person 1 of 12 under webpack/uglify as well as the legacy workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100