NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

crash with source-map instead of inline-source-map #968

Closed farfromrefug closed 5 years ago

farfromrefug commented 5 years ago

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):

By the way it's kind of a requirement for me to use source-map. I use Bugsnag where map files are uploaded using .map files (i then filter with gradle so that map files are not included in the apk for size reasons).

Anyone has any idea why it could fail to require the .map file?

DimitarTachev commented 5 years ago

Hi @farfromrefug,

Thanks for reporting that!

As devtool: "source-map" is not officially supported, the code didn't expect file extensions different than .js. I've opened a pull request with a fix and most probably it will be released in nativescript-dev-webpack@1.0.1 as the development for 1.0.0 is already frozen.

farfromrefug commented 5 years ago

@miroslavaivanova @Fatme @DimitarTachev this is not fixed. The generated source map is wrong. It seems like you add require("./snapshot-entry.js");require("./vendor.js"); at the start of the file which makes the source map not work. Can we re open this?

I tested and you just need to test for this.isSourceFile(filePath) in this line

DimitarTachev commented 5 years ago

Hi @farfromrefug,

Thanks for reporting back. We've fixed the app crash but we've missed the .map files content.

You are right about the fix. I've just opened a PR with it.

P.S. Feel free to directly open PRs with such fixes.

farfromrefug commented 5 years ago

@DimitarTachev Thanks! Sorry for not creating the PR, Did not really have time to create one (lazy me!)