mitodl / micromasters

Portal for learners and course teams to access MITx Micromasters® programs
https://mm.mit.edu
BSD 3-Clause "New" or "Revised" License
28 stars 16 forks source link

SyntaxError: Unexpected token 'const' #5106

Open sentry-io[bot] opened 2 years ago

sentry-io[bot] commented 2 years ago

Seems to be happening a few times every day. I don't know if there is any end-user impact.

Sentry Issue: MICROMASTERS-56X

SyntaxError: Unexpected token 'const'
  at None (/static/bundles/public-0002358d3c70c23ad5b4.js:26)
Wassaf-Shahzad commented 2 years ago

@pdpinch @blarghmatey I had a detailed discussion with @arslanashraf7 regarding this issue and unfortunately we are unable to reproduce this locally as the issue mainly arises from users hitting cloudfront url.I s there any method to reproduce this locally ?

pdpinch commented 2 years ago

It looks like sentry is having an issue parsing the sourcemap for this. Is there anything we should do to make that work better?

image
Wassaf-Shahzad commented 2 years ago

It looks like sentry is having an issue parsing the sourcemap for this. Is there anything we should do to make that work better?

image

I did some R&D for this issue and I believe our source maps are not being uploaded.if you go to Settings > Project Settings > micromasters > Source Maps and click any Archive it will give you There is no artifact in this archive.

ScreenShot

Screenshot 2021-11-04 at 4 09 08 PM
pdpinch commented 2 years ago

I'm not sure what this means. If we had the source map, would it help us find and fix this issue? What do we need to do upload them?

Wassaf-Shahzad commented 2 years ago

I'm not sure what this means. If we had the source map, would it help us find and fix this issue? What do we need to do upload them?

Yes, According to the docs

Sentry supports demangling of transpiled, minified, and bundled JavaScript using source maps, which are JSON files that contain information about how to map your deployed code back to its original source(s)

We can use sentry-webpack-plugin to generate and upload our source maps