Skip to content

Commit 6674ad6

Browse files
authored
fix(gatsby): don't break builds when using features unsupported by adapter (#38520)
1 parent d46c815 commit 6674ad6

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/gatsby-cli/src/structured-errors/error-map.ts

+3
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,9 @@ const errors: Record<string, IErrorMapEntry> = {
926926
type: Type.ADAPTER,
927927
category: ErrorCategory.SYSTEM,
928928
},
929+
// Currently not used, as the error was turned into warning
930+
// Might be used in next major version of gatsby, but we still have to keep it
931+
// because older gatsby versions might try to use this error ID
929932
"12201": {
930933
text: (context): string =>
931934
`Adapter "${

packages/gatsby/src/utils/adapter/manager.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ async function setAdapter({
7373
store.getState().program.prefixPaths &&
7474
store.getState().config.pathPrefix
7575
) {
76-
incompatibleFeatures.push(
77-
`pathPrefix is not supported. Please remove the pathPrefix option from your gatsby-config, don't use "--prefix-paths" CLI toggle or PREFIX_PATHS environment variable.`
78-
)
76+
incompatibleFeatures.push(`pathPrefix is not supported.`)
7977
}
8078

8179
// trailingSlash support
@@ -98,13 +96,13 @@ async function setAdapter({
9896
}
9997

10098
if (incompatibleFeatures.length > 0) {
101-
reporter.panic({
102-
id: `12201`,
103-
context: {
104-
adapterName: instance.name,
105-
incompatibleFeatures,
106-
},
107-
})
99+
reporter.warn(
100+
`Adapter "${
101+
instance.name
102+
}" is not compatible with following settings:\n${incompatibleFeatures
103+
.map(line => ` - ${line}`)
104+
.join(`\n`)}`
105+
)
108106
}
109107

110108
if (configFromAdapter.pluginsToDisable.length > 0) {

0 commit comments

Comments
 (0)