@m.finamor
Wow! Thank you very much. For some reasons I did not get updates on this post so I totally forgot about it.
Cloning your project in DatoCms is easy.
Adding a new reposity gives me errors upon errors. it starts in vercel, where it can not create a build, so I can not link to Dato or Github, or the other way around.
Long story short:
I need to create a deploment environment. Linking to my vercel account. Which is impossible as the vercel project does not want to build. So there is nothing to link to.
For examples: I do not know where to find:
NEXT_EXAMPLE_CMS_DATOCMS_PREVIEW_SECRET=
Similarly where do i find the build ID
NEXT_EXAMPLE_CMS_DATOCMS_BUILD_TRIGGER_ID
There is no such thing as a build trigger in my dashboard? Where do I find the build trigger?
The video seems out dated.
ps: https://www.datocms.com/docs/next-js/setting-up-next-js-preview-mode has a 404
[20:41:18.668] Error: POST failed with: 401
[20:41:18.668] at IncomingMessage. (/vercel/path0/node_modules/tiny-json-http/bundle.js:1:4950)
[20:41:18.668] at IncomingMessage.emit (node:events:525:35)
[20:41:18.668] at endReadableNT (node:internal/streams/readable:1359:12)
[20:41:18.668] at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[20:41:18.669] raw: <ref 1> IncomingMessage {
[20:41:18.669] _readableState: ReadableState {
[20:41:18.669] objectMode: false,
[20:41:18.669] highWaterMark: 16384,
[20:41:18.669] buffer: BufferList { head: null, tail: null, length: 0 },
[20:41:18.669] length: 0,
[20:41:18.670] pipes: [],
[20:41:18.670] flowing: true,
[20:41:18.670] ended: true,
[20:41:18.670] endEmitted: true,
[20:41:18.670] reading: false,
[20:41:18.670] constructed: true,
[20:41:18.670] sync: false,
[20:41:18.670] needReadable: false,
[20:41:18.670] emittedReadable: false,
[20:41:18.670] readableListening: false,
[20:41:18.670] resumeScheduled: false,
[20:41:18.670] errorEmitted: false,
[20:41:18.670] emitClose: true,
[20:41:18.670] autoDestroy: true,
[20:41:18.671] destroyed: true,
[20:41:18.671] errored: null,
[20:41:18.671] closed: true,
[20:41:18.671] closeEmitted: true,
[20:41:18.671] defaultEncoding: âutf8â,
[20:41:18.671] awaitDrainWriters: null,
[20:41:18.671] multiAwaitDrain: false,
[20:41:18.672] readingMore: false,
[20:41:18.672] dataEmitted: true,
[20:41:18.672] decoder: null,
[20:41:18.673] encoding: null,
[20:41:18.673] [Symbol(kPaused)]: false
[20:41:18.673] },
[20:41:18.673] _events: [Object: null prototype] {
[20:41:18.673] end: [Array],
[20:41:18.673] data: [Function (anonymous)]
[20:41:18.673] },
[20:41:18.674] _eventsCount: 2,
[20:41:18.674] _maxListeners: undefined,
[20:41:18.674] socket: TLSSocket {
[20:41:18.674] _tlsOptions: [Object],
[20:41:18.674] _secureEstablished: true,
[20:41:18.674] _securePending: false,
[20:41:18.674] _newSessionPending: false,
[20:41:18.674] _controlReleased: true,
[20:41:18.675] secureConnecting: false,
[20:41:18.675] _SNICallback: null,
[20:41:18.677] servername: âgraphql.datocms.comâ,
[20:41:18.677] alpnProtocol: false,
[20:41:18.677] authorized: true,
[20:41:18.677] authorizationError: null,
[20:41:18.677] encrypted: true,
[20:41:18.677] _events: [Object: null prototype],
[20:41:18.677] _eventsCount: 10,
[20:41:18.678] connecting: false,
[20:41:18.678] _hadError: false,
[20:41:18.678] _parent: null,
[20:41:18.678] _host: âgraphql.datocms.comâ,
[20:41:18.678] _closeAfterHandlingError: false,
[20:41:18.678] _readableState: [ReadableState],
[20:41:18.678] _maxListeners: undefined,
[20:41:18.678] _writableState: [WritableState],
[20:41:18.678] allowHalfOpen: false,
[20:41:18.678] _sockname: null,
[20:41:18.678] _pendingData: null,
[20:41:18.678] _pendingEncoding: ââ,
[20:41:18.678] server: undefined,
[20:41:18.678] _server: null,
[20:41:18.678] ssl: [TLSWrap],
[20:41:18.678] _requestCert: true,
[20:41:18.678] _rejectUnauthorized: true,
[20:41:18.679] parser: null,
[20:41:18.679] _httpMessage: [ClientRequest],
[20:41:18.679] [Symbol(res)]: [TLSWrap],
[20:41:18.679] [Symbol(verified)]: true,
[20:41:18.679] [Symbol(pendingSession)]: null,
[20:41:18.679] [Symbol(async_id_symbol)]: 15,
[20:41:18.679] [Symbol(kHandle)]: [TLSWrap],
[20:41:18.679] [Symbol(lastWriteQueueSize)]: 0,
[20:41:18.679] [Symbol(timeout)]: null,
[20:41:18.679] [Symbol(kBuffer)]: null,
[20:41:18.679] [Symbol(kBufferCb)]: null,
[20:41:18.679] [Symbol(kBufferGen)]: null,
[20:41:18.679] [Symbol(kCapture)]: false,
[20:41:18.679] [Symbol(kSetNoDelay)]: false,
[20:41:18.679] [Symbol(kSetKeepAlive)]: false,
[20:41:18.679] [Symbol(kSetKeepAliveInitialDelay)]: 0,
[20:41:18.679] [Symbol(kBytesRead)]: 0,
[20:41:18.679] [Symbol(kBytesWritten)]: 0,
[20:41:18.679] [Symbol(connect-options)]: [Object]
[20:41:18.679] },
[20:41:18.679] httpVersionMajor: 1,
[20:41:18.679] httpVersionMinor: 1,
[20:41:18.679] httpVersion: â1.1â,
[20:41:18.679] complete: true,
[20:41:18.679] rawHeaders: [
[20:41:18.679] âDateâ,
[20:41:18.680] âSat, 15 Jul 2023 18:41:18 GMTâ,
[20:41:18.680] âContent-Typeâ,
[20:41:18.680] âapplication/json; charset=utf-8â,
[20:41:18.680] âTransfer-Encodingâ,
[20:41:18.680] âchunkedâ,
[20:41:18.680] âConnectionâ,
[20:41:18.680] âcloseâ,
[20:41:18.680] âCF-Rayâ,
[20:41:18.680] â7e74238adb8082da-IADâ,
[20:41:18.680] âCF-Cache-Statusâ,
[20:41:18.680] âDYNAMICâ,
[20:41:18.680] âAccess-Control-Allow-Originâ,
[20:41:18.680] 'â,
[20:41:18.680] âCache-Controlâ,
[20:41:18.680] âprivateâ,
[20:41:18.680] âStrict-Transport-Securityâ,
[20:41:18.680] âmax-age=15552000; includeSubDomains; preloadâ,
[20:41:18.680] âVaryâ,
[20:41:18.680] âAccept-Encodingâ,
[20:41:18.680] âViaâ,
[20:41:18.680] â1.1 vegur, 1.1 varnish, 1.1 varnishâ,
[20:41:18.680] âAccess-Control-Allow-Credentialsâ,
[20:41:18.681] âtrueâ,
[20:41:18.681] âAccess-Control-Allow-Headersâ,
[20:41:18.681] âauthorization, content-type, x-environment, x-organization, x-site-domain, x-api-version, user-agent, x-session-id, x-include-drafts, x-exclude-invalid, x-visual-editing, x-base-editing-urlâ,
[20:41:18.681] âAccess-Control-Allow-Methodsâ,
[20:41:18.681] âGET, POST, PUT, OPTIONS, DELETEâ,
[20:41:18.681] âAccess-Control-Expose-Headersâ,
[20:41:18.681] âx-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, x-complexity, x-max-complexityâ,
[20:41:18.681] âAccess-Control-Max-Ageâ,
[20:41:18.681] â1728000â,
[20:41:18.681] âReferrer-Policyâ,
[20:41:18.681] âstrict-origin-when-cross-originâ,
[20:41:18.681] âX-Cacheâ,
[20:41:18.681] âMISS, MISSâ,
[20:41:18.681] âX-Cache-Hitsâ,
[20:41:18.681] â0, 0â,
[20:41:18.681] âX-Cacheable-On-CDNâ,
[20:41:18.681] âtrueâ,
[20:41:18.681] âX-Cacheable-On-CDN-Query-Length-Limitâ,
[20:41:18.681] â175/8192â,
[20:41:18.681] âX-Content-Type-Optionsâ,
[20:41:18.682] ânosniffâ,
[20:41:18.682] âX-Download-Optionsâ,
[20:41:18.682] ânoopenâ,
[20:41:18.682] âX-Frame-Optionsâ,
[20:41:18.682] âSAMEORIGINâ,
[20:41:18.682] âX-Permitted-Cross-Domain-Policiesâ,
[20:41:18.682] ânoneâ,
[20:41:18.682] âX-Queue-Timeâ,
[20:41:18.682] â1msâ,
[20:41:18.682] âX-Ratelimit-Limitâ,
[20:41:18.682] â40â,
[20:41:18.682] âX-Ratelimit-Remainingâ,
[20:41:18.683] â39â,
[20:41:18.683] âX-Request-Idâ,
[20:41:18.683] â4fd9ca60-c65a-446f-bf65-769db61d4138â,
[20:41:18.683] âX-Runtimeâ,
[20:41:18.683] â0.004508â,
[20:41:18.683] âX-Served-Byâ,
[20:41:18.683] âcache-dub4328-DUB, cache-iad-kiad7000055-IADâ,
[20:41:18.683] âX-Timerâ,
[20:41:18.683] âS1689446479.549097,VS0,VE107â,
[20:41:18.683] âX-Xss-Protectionâ,
[20:41:18.683] â1; mode=blockâ,
[20:41:18.683] âServerâ,
[20:41:18.683] âcloudflareâ
[20:41:18.683] ],
[20:41:18.683] rawTrailers: [],
[20:41:18.683] joinDuplicateHeaders: undefined,
[20:41:18.684] aborted: false,
[20:41:18.684] upgrade: false,
[20:41:18.684] url: ââ,
[20:41:18.684] method: null,
[20:41:18.684] statusCode: 401,
[20:41:18.684] statusMessage: âUnauthorizedâ,
[20:41:18.684] client: TLSSocket {
[20:41:18.684] _tlsOptions: [Object],
[20:41:18.684] _secureEstablished: true,
[20:41:18.684] _securePending: false,
[20:41:18.684] _newSessionPending: false,
[20:41:18.684] _controlReleased: true,
[20:41:18.684] secureConnecting: false,
[20:41:18.684] _SNICallback: null,
[20:41:18.684] servername: âgraphql.datocms.comâ,
[20:41:18.684] alpnProtocol: false,
[20:41:18.684] authorized: true,
[20:41:18.684] authorizationError: null,
[20:41:18.684] encrypted: true,
[20:41:18.684] _events: [Object: null prototype],
[20:41:18.685] _eventsCount: 10,
[20:41:18.685] connecting: false,
[20:41:18.685] _hadError: false,
[20:41:18.685] _parent: null,
[20:41:18.685] _host: âgraphql.datocms.comâ,
[20:41:18.685] _closeAfterHandlingError: false,
[20:41:18.686] _readableState: [ReadableState],
[20:41:18.686] _maxListeners: undefined,
[20:41:18.686] _writableState: [WritableState],
[20:41:18.686] allowHalfOpen: false,
[20:41:18.686] _sockname: null,
[20:41:18.686] _pendingData: null,
[20:41:18.686] _pendingEncoding: ââ,
[20:41:18.686] server: undefined,
[20:41:18.686] _server: null,
[20:41:18.686] ssl: [TLSWrap],
[20:41:18.686] _requestCert: true,
[20:41:18.686] _rejectUnauthorized: true,
[20:41:18.686] parser: null,
[20:41:18.686] _httpMessage: [ClientRequest],
[20:41:18.686] [Symbol(res)]: [TLSWrap],
[20:41:18.686] [Symbol(verified)]: true,
[20:41:18.687] [Symbol(pendingSession)]: null,
[20:41:18.687] [Symbol(async_id_symbol)]: 15,
[20:41:18.687] [Symbol(kHandle)]: [TLSWrap],
[20:41:18.687] [Symbol(lastWriteQueueSize)]: 0,
[20:41:18.687] [Symbol(timeout)]: null,
[20:41:18.687] [Symbol(kBuffer)]: null,
[20:41:18.687] [Symbol(kBufferCb)]: null,
[20:41:18.687] [Symbol(kBufferGen)]: null,
[20:41:18.687] [Symbol(kCapture)]: false,
[20:41:18.687] [Symbol(kSetNoDelay)]: false,
[20:41:18.687] [Symbol(kSetKeepAlive)]: false,
[20:41:18.687] [Symbol(kSetKeepAliveInitialDelay)]: 0,
[20:41:18.687] [Symbol(kBytesRead)]: 0,
[20:41:18.687] [Symbol(kBytesWritten)]: 0,
[20:41:18.687] [Symbol(connect-options)]: [Object]
[20:41:18.687] },
[20:41:18.688] _consuming: true,
[20:41:18.688] _dumped: false,
[20:41:18.688] req: ClientRequest {
[20:41:18.688] _events: [Object: null prototype],
[20:41:18.688] _eventsCount: 2,
[20:41:18.688] _maxListeners: undefined,
[20:41:18.688] outputData: [],
[20:41:18.688] outputSize: 0,
[20:41:18.688] writable: true,
[20:41:18.688] destroyed: false,
[20:41:18.688] _last: true,
[20:41:18.688] chunkedEncoding: false,
[20:41:18.688] shouldKeepAlive: false,
[20:41:18.688] maxRequestsOnConnectionReached: false,
[20:41:18.688] _defaultKeepAlive: true,
[20:41:18.688] useChunkedEncodingByDefault: true,
[20:41:18.688] sendDate: false,
[20:41:18.688] _removedConnection: false,
[20:41:18.689] _removedContLen: false,
[20:41:18.689] _removedTE: false,
[20:41:18.689] strictContentLength: false,
[20:41:18.689] _contentLength: 66,
[20:41:18.689] _hasBody: true,
[20:41:18.689] _trailer: ââ,
[20:41:18.689] finished: true,
[20:41:18.689] _headerSent: true,
[20:41:18.689] _closed: false,
[20:41:18.689] socket: [TLSSocket],
[20:41:18.689] _header: âPOST / HTTP/1.1\r\nâ +
[20:41:18.689] âauthorization: Bearer undefined\r\nâ +
[20:41:18.689] âuser-agent: tiny-http\r\nâ +
[20:41:18.689] âcontent-type: application/json; charset=utf-8\r\nâ +
[20:41:18.689] âContent-Length: 66\r\nâ +
[20:41:18.689] âHost: graphql.datocms.com\r\nâ +
[20:41:18.689] âConnection: close\r\nâ +
[20:41:18.690] â\r\nâ,
[20:41:18.690] _keepAliveTimeout: 0,
[20:41:18.690] _onPendingData: [Function: nop],
[20:41:18.690] agent: [Agent],
[20:41:18.690] socketPath: undefined,
[20:41:18.690] method: âPOSTâ,
[20:41:18.690] maxHeaderSize: undefined,
[20:41:18.690] insecureHTTPParser: undefined,
[20:41:18.690] joinDuplicateHeaders: undefined,
[20:41:18.690] path: â/â,
[20:41:18.690] _ended: true,
[20:41:18.690] res: [Circular 1],
[20:41:18.690] aborted: false,
[20:41:18.690] timeoutCb: null,
[20:41:18.690] upgradeOrConnect: false,
[20:41:18.690] parser: null,
[20:41:18.691] maxHeadersCount: null,
[20:41:18.691] reusedSocket: false,
[20:41:18.691] host: âgraphql.datocms.comâ,
[20:41:18.691] protocol: âhttps:â,
[20:41:18.691] [Symbol(kCapture)]: false,
[20:41:18.691] [Symbol(kBytesWritten)]: 0,
[20:41:18.691] [Symbol(kNeedDrain)]: false,
[20:41:18.691] [Symbol(corked)]: 0,
[20:41:18.691] [Symbol(kOutHeaders)]: [Object: null prototype],
[20:41:18.691] [Symbol(errored)]: null,
[20:41:18.691] [Symbol(kUniqueHeaders)]: null
[20:41:18.691] },
[20:41:18.691] [Symbol(kCapture)]: false,
[20:41:18.691] [Symbol(kHeaders)]: {
[20:41:18.691] date: âSat, 15 Jul 2023 18:41:18 GMTâ,
[20:41:18.691] âcontent-typeâ: âapplication/json; charset=utf-8â,
[20:41:18.692] âtransfer-encodingâ: âchunkedâ,
[20:41:18.692] connection: âcloseâ,
[20:41:18.692] âcf-rayâ: â7e74238adb8082da-IADâ,
[20:41:18.692] âcf-cache-statusâ: âDYNAMICâ,
[20:41:18.692] âaccess-control-allow-originâ: 'â,
[20:41:18.692] âcache-controlâ: âprivateâ,
[20:41:18.692] âstrict-transport-securityâ: âmax-age=15552000; includeSubDomains; preloadâ,
[20:41:18.692] vary: âAccept-Encodingâ,
[20:41:18.692] via: â1.1 vegur, 1.1 varnish, 1.1 varnishâ,
[20:41:18.692] âaccess-control-allow-credentialsâ: âtrueâ,
[20:41:18.692] âaccess-control-allow-headersâ: âauthorization, content-type, x-environment, x-organization, x-site-domain, x-api-version, user-agent, x-session-id, x-include-drafts, x-exclude-invalid, x-visual-editing, x-base-editing-urlâ,
[20:41:18.692] âaccess-control-allow-methodsâ: âGET, POST, PUT, OPTIONS, DELETEâ,
[20:41:18.692] âaccess-control-expose-headersâ: âx-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, x-complexity, x-max-complexityâ,
[20:41:18.692] âaccess-control-max-ageâ: â1728000â,
[20:41:18.692] âreferrer-policyâ: âstrict-origin-when-cross-originâ,
[20:41:18.692] âx-cacheâ: âMISS, MISSâ,
[20:41:18.692] âx-cache-hitsâ: â0, 0â,
[20:41:18.692] âx-cacheable-on-cdnâ: âtrueâ,
[20:41:18.693] âx-cacheable-on-cdn-query-length-limitâ: â175/8192â,
[20:41:18.693] âx-content-type-optionsâ: ânosniffâ,
[20:41:18.693] âx-download-optionsâ: ânoopenâ,
[20:41:18.693] âx-frame-optionsâ: âSAMEORIGINâ,
[20:41:18.693] âx-permitted-cross-domain-policiesâ: ânoneâ,
[20:41:18.693] âx-queue-timeâ: â1msâ,
[20:41:18.693] âx-ratelimit-limitâ: â40â,
[20:41:18.693] âx-ratelimit-remainingâ: â39â,
[20:41:18.693] âx-request-idâ: â4fd9ca60-c65a-446f-bf65-769db61d4138â,
[20:41:18.693] âx-runtimeâ: â0.004508â,
[20:41:18.693] âx-served-byâ: âcache-dub4328-DUB, cache-iad-kiad7000055-IADâ,
[20:41:18.693] âx-timerâ: âS1689446479.549097,VS0,VE107â,
[20:41:18.693] âx-xss-protectionâ: â1; mode=blockâ,
[20:41:18.693] server: âcloudflareâ
[20:41:18.693] },
[20:41:18.693] [Symbol(kHeadersCount)]: 68,
[20:41:18.693] [Symbol(kTrailers)]: null,
[20:41:18.693] [Symbol(kTrailersCount)]: 0
[20:41:18.693] },
[20:41:18.693] body: { data: [ [Object] ] },
[20:41:18.693] statusCode: 401
[20:41:18.693] }
[20:41:18.696]
[20:41:18.696] > Build error occurred
[20:41:18.697] Error: Failed to collect page data for /posts/[slug]
[20:41:18.697] at /vercel/path0/node_modules/next/dist/build/utils.js:916:15
[20:41:18.697] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[20:41:18.697] type: âErrorâ
[20:41:18.697] }
[20:41:18.750] Error: Command ânpm run buildâ exited with 1
(its probably just me â being overwhelmed with what do to first, or understand everything well)
I do understand that you have changed the [slug].js , is there any other file you have altered?
Maybe I can transform the basic datocms blog example based on your alternations.
But after trying that I get several other errors which are too long to copy and paste here. I am currently in a sort of loophole of errors.
Regardless, I will continue to find my way through all of this and my thanks is huge for all of this.