@netlify/build 27.6.0 → 27.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "27.6.0",
3
+ "version": "27.7.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./src/core/main.js",
@@ -56,7 +56,7 @@
56
56
  "license": "MIT",
57
57
  "dependencies": {
58
58
  "@bugsnag/js": "^7.0.0",
59
- "@netlify/edge-bundler": "^1.7.0",
59
+ "@netlify/edge-bundler": "^1.8.0",
60
60
  "@netlify/cache-utils": "^4.0.0",
61
61
  "@netlify/config": "^18.1.2",
62
62
  "@netlify/functions-utils": "^4.2.2",
@@ -32,9 +32,9 @@ const normalizeMessage = function (message, [regExp, replacement]) {
32
32
 
33
33
  const NORMALIZE_REGEXPS = [
34
34
  // Base64 URL
35
- [/(data:[^;]+;base64),[\w+/-]+/g, 'dataURI'],
35
+ [/(data:[^;]+;base64),[\w+/-=]+/g, 'dataURI'],
36
36
  // File paths
37
- [/(["'`, ]|^)([^"'`, \n]*[/\\][^"'`, \n]*)(["'`, ]|$)/gm, '$1/file/path$3'],
37
+ [/(["'`, ]|^)([^"'`, \n]*[/\\][^"'`, \n]*)(?=["'`, ]|$)/gm, '$1/file/path'],
38
38
  // Semantic versions
39
39
  [/\d+\.\d+\.\d+(-\d+)?/g, '1.0.0'],
40
40
  [/version "[^"]+"/g, 'version "1.0.0"'],
@@ -45,7 +45,7 @@ const NORMALIZE_REGEXPS = [
45
45
  // Numbers, e.g. number of issues/problems
46
46
  [/\d+/g, '0'],
47
47
  // Hexadecimal strings
48
- [/[\da-fA-F]{6,}/g, 'hex'],
48
+ [/[\da-fA-F-]{6,}/g, 'hex'],
49
49
  // On unknown inputs, we print the inputs
50
50
  [/(does not accept any inputs but you specified: ).*/, '$1'],
51
51
  [/(Unknown inputs for plugin).*/, '$1'],
@@ -74,4 +74,6 @@ const NORMALIZE_REGEXPS = [
74
74
  [/(Parse Error):[^]*/, '$1'],
75
75
  // Multiple empty lines
76
76
  [/^\s*$/gm, ''],
77
+ // Function bundling errors
78
+ [/Bundling of function "([^"]+)" failed/gm, 'Bundling of function "functionName" failed'],
77
79
  ]
@@ -21,7 +21,7 @@ export const reportBuildError = async function ({ error, errorMonitor, childEnv,
21
21
  const { errorInfo, type, severity, title, group = title } = parseErrorInfo(error)
22
22
  const severityA = getSeverity(severity, errorInfo)
23
23
  const groupA = getGroup(group, errorInfo)
24
- const groupingHash = getGroupingHash(groupA, error, type)
24
+ const groupingHash = getGroupingHash(groupA, error, type, errorInfo)
25
25
  const metadata = getMetadata(errorInfo, childEnv, groupingHash)
26
26
  const app = getApp()
27
27
  const eventProps = getEventProps({ severity: severityA, group: groupA, groupingHash, metadata, app })
@@ -52,7 +52,12 @@ const getGroup = function (group, errorInfo) {
52
52
  return group(errorInfo)
53
53
  }
54
54
 
55
- const getGroupingHash = function (group, error, type) {
55
+ const getGroupingHash = function (group, error, type, errorInfo = {}) {
56
+ // If the error has a `normalizedMessage`, we use it as the grouping hash.
57
+ if (errorInfo.normalizedMessage) {
58
+ return errorInfo.normalizedMessage
59
+ }
60
+
56
61
  const message = error instanceof Error && typeof error.message === 'string' ? error.message : String(error)
57
62
  const messageA = normalizeGroupingMessage(message, type)
58
63
  return `${group}\n${messageA}`