Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiding sourcemaps causes Cordova HCP to fail #23

Open
hexsprite opened this issue Jun 13, 2019 · 8 comments
Open

hiding sourcemaps causes Cordova HCP to fail #23

hexsprite opened this issue Jun 13, 2019 · 8 comments

Comments

@hexsprite
Copy link

hexsprite commented Jun 13, 2019

The sourcemap is listened in the __cordova/manifest.json but it results in a 404 error causing the meteor cordova plugin to give up on the download.

For now I'm just using the following in my build script:

# post-process Cordova config to remove sourcemap URLs
CORDOVA_MANIFEST=bundle/programs/web.cordova/program.json
JQ_FILTER='del(.manifest[].sourceMap) | del(.manifest[].sourceMapUrl)'
jq $JQ_FILTER $CORDOVA_MANIFEST > $CORDOVA_MANIFEST.tmp \
  && mv -f $CORDOVA_MANIFEST.tmp $CORDOVA_MANIFEST

I'm not sure if that means I won't get proper sourcemaps if an error occurs in the cordova version my app or not?

@hexsprite
Copy link
Author

Maybe I'm being overzealous and I only need to remove the sourceMap attribute and should leave sourceMapUrl so that error tracking software can still reference the proper sourcemap...

@hexsprite
Copy link
Author

Also it occurs to me that this is perhaps a "bug" in the meteor cordova plugin in that it should potentially warn instead of fail in the case that the source maps are not available...

@banjerluke
Copy link
Contributor

Thanks for reporting this, and for your solution... I discovered this myself after some banging of head against wall, and was glad to see I wasn't the only one, and even more happy to find a quick solution via updating my build script.

For anyone reading this who wants to take a stab at addressing the root problem of the update failing with missing sourcemaps, the error is coming from cordova-plugin-meteor-webapp – specifically, this function. But I'm going to just stick with the workaround for now.

@zodern
Copy link
Owner

zodern commented Sep 4, 2020

Does cordova actually use the source maps? We could have Webapp serve an empty source map instead.

@hexsprite
Copy link
Author

I don't know if Cordova itself does. But I would certainly love it if I could get sourcemapped tracebacks in my error tracking service of choice.

@zodern
Copy link
Owner

zodern commented Sep 4, 2020

If cordova does, we can create a source map that is valid but doesn't do anything, but it will be slower.

But I would certainly love it if I could get sourcemapped tracebacks in my error tracking service of choice.

I haven't tried it with cordova, but I thought it would work the same as with the web architectures. What have you tried and what issues exist?

@hexsprite
Copy link
Author

It may be a configuration with the error service I use (Rollbar) but they seem to fail to map the sourcemaps when using Cordova.

image

What can I do to dig a little deeper?

@tryhardest
Copy link

Did you yield a solution here @hexsprite we also use Cordova and Rollbar and cant get sourcemaps. ;/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants