stealjs/steal-tools

Treeshaking bug: imported function with identical name as function in viewmodel

SRoeffaers opened this issue · 3 comments

Setup: I import a function, and I have a function with the same name in my ViewModel.
Action: I call the function in my ViewModel, which triggers the imported function
Problem: The function of my ViewModel is being called twice. The scope is all wrong. Even 'this' is undefined..

It only happens when I have build it WITH TREESHAKING enabled. In the unbuild version, and in the version without treeshaking, everything works as expected.

Example of setup: https://codepen.io/Kleppo/pen/aRJrMz?editors=1111

Thanks for reporting!

Any idea if/when this is going to be fixed? :-)

I was unable to replicate the issue using the code in the pen.

I'm going to close this issue, @Kleppo feel free to re-open if you're able to replicate, you can find my code here https://github.com/m-mujica/steal-issue-1082. Feel free to submit any change to that code so I can see the error.