-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser -
@sentry/node -
raven-js -
raven-node(raven for node) - other:
Version:
6.2.2
Description
I’m updating Sentry to the latest version in one of my custom libraries for errors reporting (which uses Sentry as a dependency).
The problem I noticed after the update to 6.2.2 (current latest) is that I wasn't able to compile it (I use Webpack and Babel) the code with success — it actually succeeded but an error at the end occurred:
[45] ./src/index.js + 153 modules 567 kB {0} [built]
+ 51 hidden modules
ERROR in unknown: Invalid typeof value
npm ERR! code ELIFECYCLEAfter deeper investigation it turned out that it’s because Babel doesn’t know (yet) the bigint type in their compilation process:
https://github.com/babel/babel/blob/4b674ea0319340be7b0ccd53f52dc80f4ebaca04/packages/babel-types/src/builders/flow/createTypeAnnotationBasedOnTypeof.ts#L15-L22
and the bigint exists in Sentry Browser since 5.29.1: #3108
My workaround is to disable simplify option (which is enabled by default and causes the whole package code recompilation, in my case the imported Sentry Browser’s code as well) in babel-minify-webpack-plugin:
// webpack.config.js
const MinifyPlugin = require('babel-minify-webpack-plugin');
module.exports = {
...
plugins: [
new MinifyPlugin({
simplify: false,
}, {})
],
};Note: This issue is not a problem with Sentry itself — I’m just pointing out and sharing the wider landscape of possible bug. I believe it could help the others who use similiar stack. I spent enough time on investigation so it deserves describing. And I think this is the proper place for it.