@sentry/gatsby 7.47.0 → 7.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gatsby-browser.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-console */
2
- const Sentry = require('@sentry/gatsby');
2
+ import { init } from '@sentry/gatsby';
3
3
 
4
- exports.onClientEntry = function (_, pluginParams) {
4
+ export function onClientEntry(_, pluginParams) {
5
5
  const isIntialized = isSentryInitialized();
6
6
  const areOptionsDefined = areSentryOptionsDefined(pluginParams);
7
7
 
@@ -24,12 +24,12 @@ exports.onClientEntry = function (_, pluginParams) {
24
24
  return;
25
25
  }
26
26
 
27
- Sentry.init({
27
+ init({
28
28
  // eslint-disable-next-line no-undef
29
29
  dsn: __SENTRY_DSN__,
30
30
  ...pluginParams,
31
31
  });
32
- };
32
+ }
33
33
 
34
34
  function isSentryInitialized() {
35
35
  // Although `window` should exist because we're in the browser (where this script
package/gatsby-node.js CHANGED
@@ -46,8 +46,15 @@ exports.onCreateWebpackConfig = ({ plugins, getConfig, actions }) => {
46
46
  // Handle sentry-cli configuration errors when the user has not done it not to break
47
47
  // the build.
48
48
  errorHandler(err, invokeErr) {
49
- const { message } = err;
49
+ const message = err.message && err.message.toLowerCase() || '';
50
50
  if (message.includes('organization slug is required') || message.includes('project slug is required')) {
51
+ // eslint-disable-next-line no-console
52
+ console.log('Sentry [Info]: Not uploading source maps due to missing SENTRY_ORG and SENTRY_PROJECT env variables.')
53
+ return;
54
+ }
55
+ if (message.includes('authentication credentials were not provided')) {
56
+ // eslint-disable-next-line no-console
57
+ console.warn('Sentry [Warn]: Cannot upload source maps due to missing SENTRY_AUTH_TOKEN env variable.')
51
58
  return;
52
59
  }
53
60
  invokeErr(err);
@@ -93,7 +100,7 @@ function injectSentryConfig(config, configFile) {
93
100
  } else {
94
101
  // eslint-disable-next-line no-console
95
102
  console.error(
96
- `Sentry Logger [Error]: Could not inject SDK initialization code into ${prop}, unexpected format: `,
103
+ `Sentry [Error]: Could not inject SDK initialization code into ${prop}, unexpected format: `,
97
104
  typeof value,
98
105
  );
99
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/gatsby",
3
- "version": "7.47.0",
3
+ "version": "7.49.0",
4
4
  "description": "Official Sentry SDK for Gatsby.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby",
@@ -20,10 +20,10 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@sentry/core": "7.47.0",
24
- "@sentry/react": "7.47.0",
25
- "@sentry/types": "7.47.0",
26
- "@sentry/utils": "7.47.0",
23
+ "@sentry/core": "7.49.0",
24
+ "@sentry/react": "7.49.0",
25
+ "@sentry/types": "7.49.0",
26
+ "@sentry/utils": "7.49.0",
27
27
  "@sentry/webpack-plugin": "1.19.0"
28
28
  },
29
29
  "peerDependencies": {