You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.",
390
-
undefined,
391
-
undefined,
392
-
)
393
-
}
394
-
395
-
// If the global fetch function is used, we must bind it to the global scope.
"@prismicio/client only supports Prismic Rest API V2. Please provide only the repository name to the first createClient() parameter or use the getRepositoryEndpoint() helper to generate a valid Rest API V2 endpoint URL.",
`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg("endpoint-must-use-cdn")}`,
426
-
)
427
-
}
428
-
429
-
// Warn if the user provided both a repository endpoint and an `documentAPIEndpoint` and they are different
`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${devMsg("prefer-repository-name")}`,
`[@prismicio/client] A repository name could not be inferred from the provided endpoint (\`${repositoryNameOrEndpoint}\`). Some methods will be disabled. Create the client using a repository name to prevent this warning. For more details, see ${devMsg("prefer-repository-name")}`,
"A valid fetch implementation was not provided. In environments where fetch is not available, a fetch implementation must be provided via a polyfill or the `fetch` option.",
410
+
undefined,
411
+
undefined,
412
+
)
413
+
}
414
+
if(typeoffetch!=="function"){
415
+
thrownewPrismicError(
416
+
`fetch must be a function, but received: ${typeoffetch}`,
`documentAPIEndpoint is not a valid URL: ${documentAPIEndpoint}`,
425
+
undefined,
426
+
undefined,
427
+
)
428
+
}
429
+
if(
430
+
isRepositoryEndpoint(repositoryNameOrEndpoint)&&
431
+
documentAPIEndpoint&&
432
+
repositoryNameOrEndpoint!==documentAPIEndpoint
433
+
){
434
+
console.warn(
435
+
`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${devMsg("prefer-repository-name")}`,
"@prismicio/client only supports Prismic Rest API V2. Please provide only the repository name to the first createClient() parameter or use the getRepositoryEndpoint() helper to generate a valid Rest API V2 endpoint URL.",
444
+
undefined,
445
+
undefined,
446
+
)
447
+
}
448
+
if(
449
+
/(?<!\.cdn)\.prismic\.io$/i.test(
450
+
newURL(this.documentAPIEndpoint).hostname,
451
+
)&&
452
+
process.env.NODE_ENV==="development"
453
+
){
454
+
console.warn(
455
+
`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg("endpoint-must-use-cdn")}`,
0 commit comments