NativeScript / NativeScript/NativeScript

Parents expression shows [object Object] with webpack in uglify

Open
#7,449 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug os: android
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

  1. Clone git project https://github.com/rakeshgirase/ParentAabIssue.git.
  2. Run the program on android tns run android --env.uglify
  3. 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:
Screenshot_20190702-195150

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.