tobydeh / nativescript-download-progress

Download large files in Nativescript with progress events
Apache License 2.0
11 stars 16 forks source link

Bug: webpack hangs with ns-dev-webpack 1.4.0+ and this module #15

Closed bradmartin closed 4 years ago

bradmartin commented 4 years ago

Which platform(s) does your issue occur on?

Android only tested

Please, provide the following version numbers that your issue occurs with:

I'm working through this and I've narrowed down the issue to this plugin. Not saying it's at fault since this plugin works fine with ns-dev-webpack 1.3.0 but it will hang at webpack during a build with ns-dev-webpack 1.4.0+. Trying to confirm which file might be possible for the hanging. At the moment, I'm not sure.

Confirmed it's this module but removing this specific dependency and then webpack succeeds, re-add the plugin and hangs again.

bradmartin commented 4 years ago

I have confirmed it's related to the worker file in this plugin. If I remove the worker file directly from node_modules then webpack no longer hangs. I'm looking now to see what changed with dev-webpack that might have introduced this issue.

tobydeh commented 4 years ago

Thanks for the detailed report.

Could you please try testing the previous version (1.2.0)

bradmartin commented 4 years ago

I believe I tested and same result, but I will do it again and confirm that removing the worker file fixes it or not.

bradmartin commented 4 years ago

Okay, did confirm same for version 1.2.0. Deleting the worker file allows webpack to finish. Of course it errors because the worker file cannot be found but it no longer hangs. So this seems to be something that changed with the minor 1.4.0 from 1.3.0 of nativescript-dev-webpack


ERROR in ../node_modules/nativescript-download-progress/download-progress.js
Module not found: Error: Can't resolve './android-worker.js' in '/Users/bradmartin/projects/permobil-client/apps/wear/smartdrive/node_modules/nativescript-download-progress'
 @ ../node_modules/nativescript-download-progress/download-progress.js 14:31-88
 @ ./namespaces/smartdrive-data.ts
 @ . sync (?<!\bApp_Resources\b.*)(?<!\.\/\btests\b\/.*?)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$
 @ ./app.ts
bradmartin commented 4 years ago

Was just reminded that we actually have this plugin in a different app and it works fine. The difference between the app is the working is angular, the hanging one is NS Core (vanilla). So it's likely something in the webpack.config differences between angular projects vs. core.

tobydeh commented 4 years ago

I've tested on a vanilla + angular, cli: 6.3.3, tns-core-modules: 6.3.2 tns-android: 6.3.1 and cant reproduce the issue.

bradmartin commented 4 years ago

Yea I see that now, it's some combination of the deps in the project causing it, just haven't nailed it down. I do know removing the worker file fixes it but obviously it's not the root cause. Odd issue for sure, fun times 😄