Skip to main content

Template and section errors

These errors are about one template or one section. The cause is its route, its Template URL, the Canvas URL, or the template your code asks for. If other templates work but this one, or this section, doesn't, start here. The example is the Blog project, previewing AI 101 on the Blog post template, and the Blog app built with the Next.js App Router.

After you fix any of these, reload the canvas. The card goes away when the fix worked. For an error you only see in a log, reload the page and check the log line is gone.

Your routes and settings, line by line​

A template or section reaches the canvas through three settings in Studio and two routes in your app. Find the piece your card names, check it, then read its section.

// app/[[...slug]]/page.tsx, your catch-all route. It serves every template.
const specOptions = await sdk.fetchCompositionData({ url, searchQuery });

// app/[[...slug]]/template-renderer.tsx renders what the fetch returned.
return <StudioComponent specOptions={specOptions} />;

// app/canvas/page.tsx, your canvas route. It serves every section.
return <StudioCanvas />;
PieceWhere you set itIf it's wrong
Base URLThe environment's URL for the language, in Contentstack. Studio shows it on Settings > Configuration.The Base URL ends in a path, The Base URL points at the canvas page
Template URLEdit URL in the canvas top barThe Template URL is missing or can't be used, Two templates claim the same address, No template has this address
Canvas URLSettings > Configuration > Canvas URLSections don't open at the Canvas URL
The route that answers the addressapp/[[...slug]]/page.tsx, unless another route answers firstThe template's route has no Studio code
What the route asks forThe first argument of sdk.fetchCompositionDataThe route always shows another template, Your code doesn't say which template to fetch, The address is nearly right
The component a template renders with<StudioComponent />, in template-renderer.tsxThe wrong Studio component renders it
The component a section renders with<StudioCanvas />, in app/canvas/page.tsxSections don't open at the Canvas URL

The whole catch-all is in Fetch the template in a Server Component. The canvas route is in Render StudioCanvas on the route. How the canvas joins the Base URL with the Template URL or Canvas URL is in URLs and routes.

Find your error​

You seeCode
No Studio Code on This RouteROUTE_RENDERS_NO_TEMPLATE
URL Pinned to Another Template, or Other Templates Load HereROUTE_PINNED_TO_ANOTHER_TEMPLATE
Your Site's Setup Is Incomplete, saying Studio needs a composition to loadCOMPOSITION_IDENTIFIER_MISSING
A Closer URL Match Won, Another Entry Owns This URL, or Multiple Templates Use This URLTEMPLATE_URL_CONFLICT
This Address Is Nearly RightTEMPLATE_ADDRESS_NEARLY_MATCHES
The URL is not present for this composition on a freeform template, or Invalid Custom URLTEMPLATE_URL_INVALID
Use Studio Component, on a template that opens at the Canvas URLTEMPLATE_ADDRESS_IS_CANVAS_ROUTE
Use Studio Component, or Sections Need StudioCanvasWRONG_STUDIO_RENDERER
Canvas URL is not configured, or Studio Canvas Isn't on This RouteCANVAS_URL_INVALID
Couldn't Determine the CauseTEMPLATE_DID_NOT_RENDER
The Page Asks for a Missing TemplateCOMPOSITION_UID_NOT_FOUND
A log line saying the template a cs-template link names can't be shownREQUESTED_COMPOSITION_UNAVAILABLE
A log line saying no template at this URL is the primary oneNO_PRIMARY_TEMPLATE_FOR_SECONDARY
Nothing Is Set Up for This AddressNO_COMPOSITION_FOR_URL
No Template Uses This Content TypeNO_COMPOSITION_FOR_TEMPLATE_CONTENT_TYPE
Connected Content Type Not AvailableCONNECTED_CONTENT_TYPE_MISSING
Nothing Is Set Up for This Address, naming a languageURL_LOCALE_NOT_FOUND
Your Content Didn't Load, with SPEC_UNREADABLE in the logSPEC_UNREADABLE
Composition Not FoundOPENED_COMPOSITION_NOT_FOUND

If the card is about Live Preview, such as Unpublished Templates Can't Load Here, read Live Preview errors.

The template's route has no Studio code​

Code: ROUTE_RENDERS_NO_TEMPLATE

Studio opened the template's address and waited, and nothing on the page asked Studio for a template. After about 12 seconds the card No Studio Code on This Route appears. Your live page is unaffected and logs nothing, so you only see this inside Studio.

Studio renders a template only when your route passes it the address, as URLs and routes explains.

A visitor's browser and the Studio canvas both ask your site for /blog/ai-101. The catch-all route app/[[...slug]]/page.tsx passes the address to Studio as url, Studio finds the Blog post template and then the AI 101 entry, and StudioComponent renders them, as the page for the visitor and for editing on the canvas.

The &quot;No Studio Code on This Route&quot; card while the Blog post template is open, naming the template UID blog_post and the URL /blog/ai-101.

Studio can't tell these two apart, so check your route code.

CheckRead
The route renders its own content, with no <StudioComponent />The route is built without Studio
The route has <StudioComponent />, but stops before it rendersThe route returns before Studio renders
The route has <StudioComponent />, and code in the browser changes the page's addressYour page drops Studio's query string

The route is built without Studio​

A route your app builds by hand answers the template's address, so the catch-all never sees it. In Next.js, a more specific route, such as app/blog/[slug]/page.tsx, answers before app/[[...slug]]/page.tsx.

  1. Find the file that answers the address on the card, such as /blog/ai-101. In the App Router, look for a folder that matches it, such as app/blog/[slug]/. If only app/[[...slug]]/ matches, read The route returns before Studio renders instead.
  2. If that address should show the Studio template, delete the route, so the catch-all answers it. To keep a route of its own, make it fetch the template and render <StudioComponent />, as Give one template its own route shows.
  3. If the address isn't meant for Studio, change the template's Template URL instead, with Edit URL in the canvas top bar. See Edit or reset a Template URL.

Which routes answer before the catch-all is in Keep your own routes ahead of the catch-all.

The route returns before Studio renders​

The route answers the address, but stops before it asks Studio for the template. A redirect(), a notFound() or an early return runs first.

  1. Open the route that answers the address, such as app/[[...slug]]/page.tsx.
  2. Look at the code that runs before sdk.fetchCompositionData. If a redirect(), notFound() or return runs for this address, this is your cause.
  3. Move it after the fetch, or make it skip this address. Call notFound() only when the fetch fails with a not-found, as Send a 404 when no template matches shows.

Your page drops Studio's query string​

Studio adds a query string to the address it opens, and the Studio SDK reads it from the page's address to know it's inside Studio. When code in the browser removes the query string, the SDK can't tell, and the canvas shows a card that doesn't name the real cause:

  • No Studio Code on This Route, when the page reloads without the query string before the SDK starts, such as window.location.replace(location.pathname) or a language redirect done in the browser.
  • Couldn't Determine the Cause, when code tidies the address after the SDK starts, such as history.replaceState(null, "", location.pathname).
  1. Confirm it. In the canvas, open your browser's developer tools, pick your page's frame in the Console's context menu, and run location.search. If it's empty, this is your cause.

  2. Find the code that changes the address. Search your app for location.replace, location.href =, location.assign and history.replaceState.

  3. Keep the query string when it builds the new address, such as window.location.replace(newPath + location.search), or leave the address alone.

  4. Reload the canvas. The template renders, and the card goes away.

The route always shows another template​

Code: ROUTE_PINNED_TO_ANOTHER_TEMPLATE

The route at this address fetches one template by its Template UID, compositionUid, instead of by the address. So whatever template you open there, the route shows the one in its code. With one UID, the card is URL Pinned to Another Template and names that template. With several, it's Other Templates Load Here and names them all. Changing your Template URL can't fix it, because the route never reads the address. Your live page renders the pinned template and logs nothing.

The &quot;URL Pinned to Another Template&quot; card while the Blog post template is open, saying the front-end code has About hard-coded on this URL.

  1. Find the Template UID of the template the card names, such as About. On the Templates tab, open About's row action menu and choose Edit. The Edit Template dialog shows its Template UID, such as about.

    The Edit Template dialog for Blog post, with Name editable and Template UID and Connected Content Type greyed out.

  2. Search your app for that UID, such as compositionUid: "about". The file it's in is the route that answers this address, such as app/blog/[slug]/page.tsx.

  3. If the route should serve whichever template owns the address, delete it so app/[[...slug]]/page.tsx answers. To keep the route, make it fetch by address instead:

    // app/blog/[slug]/page.tsx
    const { slug } = await params;
    const specOptions = await sdk.fetchCompositionData({
    url: `/blog/${slug}`, // was compositionUid: "about"
    searchQuery,
    });
  4. If the route must serve one template only, put your template's UID in place of the other one, such as compositionUid: "blog_post_template". Pass url too, so Studio finds the entry, as Give one template its own route shows.

  5. Reload the canvas. It shows the template you opened, and the card goes away.

Which way to fetch fits each route is in Ways to fetch a template.

Your code doesn't say which template to fetch​

Code: COMPOSITION_IDENTIFIER_MISSING

Your site asked Studio for content without compositionUid, url or templateContentTypeUid, so there was nothing to look for. The template may well exist. Inside Studio, the card is Your Site's Setup Is Incomplete, and it says Studio needs "a composition to load". It isn't a missing template, so don't answer it with a 404.

[Contentstack Studio] COMPOSITION_IDENTIFIER_MISSING: No composition was asked for.

Older SDK versions log one of these instead, with no code:

Either compositionUid, url, or templateContentTypeUid is required
No valid composition identifier provided. Please provide compositionUid, url, or templateContentTypeUid
No valid composition identifier found. Query should have compositionUid, url, or templateContentTypeUid
  1. Open the route that answers the address, such as app/[[...slug]]/page.tsx, and find its sdk.fetchCompositionData or useCompositionData call.

  2. Check the first argument. If it has none of url, compositionUid or templateContentTypeUid, or each one is empty, this is your cause.

  3. Pass one. A catch-all passes url, built from the route's path:

    // app/[[...slug]]/page.tsx
    const { slug = [] } = await params;
    const url = "/" + slug.join("/");
    const specOptions = await sdk.fetchCompositionData({ url, searchQuery });

    A route that knows its template passes compositionUid. See Ways to fetch a template.

A canvas route that reads a section's UID from the address logs this when you open it outside Studio. See A section renders with StudioComponent, by a UID from the address.

Two templates claim the same address​

Code: TEMPLATE_URL_CONFLICT

Studio finds every template whose Template URL fits the address, then picks one. When yours isn't the one picked, or yours hides another template, a card names the other one. You only see this inside Studio. Your live site serves one template and logs nothing.

Studio keeps the templates whose Template URL fits the whole address, then picks the one with the most fixed text, as How Studio matches an address to a template explains.

The address /blog/ai-101 goes through two steps. In step 1, the shortlist, Featured post's /blog/featured doesn't fit, /{{entry.url}} drops out with less fixed text, and Blog post's /blog/{{entry.slug}} stays, so Blog post wins. Step 2, the entry check, runs only when more than one template stays, such as Blog post and Topic page both at /blog/{{entry.slug}}, and on your live site the template deployed most recently that has an entry wins.

The &quot;A Closer URL Match Won&quot; card on the canvas for the Blog post template, previewing Featured at /blog/featured. It names Featured post as the template that loaded, and compares the two Template URLs.

The card names both templates, so you don't need to confirm the cause. You change a Template URL with Edit URL in the canvas top bar:

Top: the canvas top bar of the Blog post template, with the pointer on the Edit URL pencil next to /blog/featured and its &quot;Edit URL&quot; tooltip showing. Bottom: the Edit URL dialog that opens.

How Studio picks is in Which template wins when several match.

You seeRead
A Closer URL Match WonA more specific Template URL wins
Another Entry Owns This URLAnother content type's entry has this address
Multiple Templates Use This URL, and the canvas shows the other templateAnother template has the same Template URL
Multiple Templates Use This URL, and the canvas shows yoursYour template hides another one
One of these cards, while the canvas shows your site's error pageAnother template matched first and failed

A more specific Template URL wins​

Another template's Template URL has more fixed text for this address, and Studio never falls back to a less specific one. Preview Featured on the Blog post template, and Featured post's /blog/featured beats /blog/{{entry.slug}}.

  1. If the other template is meant to own this address, nothing is broken. Preview another entry on your template, such as AI 101. See Preview with a different entry.
  2. Otherwise, click Edit URL and give your template a Template URL that doesn't overlap the other one.

Another content type's entry has this address​

Your template and another one match the address equally, and only the other template's content type has an entry for it. Say the Topic page template had /blog/{{entry.slug}}. Topic page has no entries, so at /blog/ai-101 Blog post owns the address.

The &quot;Another Entry Owns This URL&quot; card on a Topic page template at /blog/ai-101, naming Blog post as the template already using it.

Click Edit URL and give your template its own fixed prefix, such as /topics/{{entry.slug}}.

Another template has the same Template URL​

Another template matches the address equally, and both have an entry for it, so your live site serves only one. The card lists every template using the URL. It happens when:

  • Two templates on one content type get the same Template URL.
  • A Custom Preview URL row has no prefix.
  • Two templates get the same fixed URL.
  • Someone edits one Template URL so it overlaps another.

Say About, a freeform template, gets the Template URL /blog/featured. A freeform template always counts as having an entry, so it ties with Featured post.

The &quot;Multiple Templates Use This URL&quot; notice on the Blog post template at /blog/ai-101, listing Blog post as displayed on the canvas and Topic page as not displayed.

The card lists the templates, so you don't need to confirm the cause. Pick the fix for what you want at the address.

What you wantRead
Your template replaces the other one, and both are on one content typeReplace the live template
Both templates stay liveGive one its own URL
The other template isn't neededDelete the other template
Every template of a content type collides, because they share {{entry.url}} or a Custom Preview URL row with no prefixFix the shared source

Replace the live template. This works only for two templates on the same content type.

  1. Open your template, click Deploy, and pick the environment, such as production.
  2. Studio opens Swap main template?, naming the template that's live at this URL. Click Swap and deploy.
  3. Studio says your template is deployed and the other was unpublished. Your live site now serves your template at that address.

See Swap the template that's live at a URL.

Give one its own URL.

  1. Pick the template that moves. For yours, click Edit URL on the card. For the other, click Open on the card, then Edit URL in its top bar.
  2. Give it a Template URL with fixed text of its own, such as /about or /blog/featured/{{entry.slug}}, and save.
  3. Reload the canvas on both templates. The notice doesn't show on either.

See Plan your Template URLs.

Delete the other template.

  1. On the Templates tab, open the other template's row action menu and choose Delete.
  2. Type DELETE and click Yes, Delete. The template goes to your stack's Trash, so you can restore it.
  3. Reload the canvas on your template. The notice doesn't show.

See Delete it.

Fix the shared source. When the Template URLs come from one source, fix it once, not template by template.

  1. If the Template URLs are {{entry.url}} with no prefix, set a Prefix in the content type's URL field, under URL Properties, such as /blog/. See Always put a prefix in front of entry.url.
  2. If they come from a Custom Preview URL row with no prefix, add one to the row. See The Custom Preview URL.
  3. A template whose URL you edited by hand keeps it. To make it follow the source again, reset it, as Go back to the derived URL shows.
  4. Reload the canvas. Each template opens at its own address, and the notice doesn't show.

Two templates on the same content type don't show this while the one you opened renders. Deploying settles which one is live. See Swap the template that's live at a URL.

Your template hides another one​

Your template rendered, and another template matches the address just as well. The card says yours "is displayed because it was updated most recently", and lists the others. Your live site serves only one of them.

  1. Click Open on the card next to another template it lists.
  2. Click Edit URL in that template's top bar, and give it a Template URL with its own fixed text.
  3. Do the same for each template the card lists, then open your template again. The card goes away.

Another template matched first and failed​

A more general template, such as one with /{{entry.url}}, matched the address and found no entry for it. The canvas shows your site's error page, but the card still names that template as the winner. Your log shows that template's missing entry.

  1. Click Open on the card to open the template it names.
  2. If its Template URL starts with a variable, such as /{{entry.url}}, put a fixed prefix in front of it with Edit URL, such as /pages/{{entry.url}}. See Always put a prefix in front of entry.url.
  3. If that template should own the address, give it an entry for it instead. See The entry isn't found.

The address is nearly right​

Code: TEMPLATE_ADDRESS_NEARLY_MATCHES

Studio compared the address your page asked for with your template's Template URL, and they differ by one small thing. The card This Address Is Nearly Right shows both addresses. It names no cause, because Studio can't see what changed the address. Your site's log only shows NO_COMPOSITION_FOR_URL for the changed address.

The &quot;This Address Is Nearly Right&quot; card for /Blog/ai-101 on the Blog post template, noting the two differ only in capitalization.

Studio spots four differences: an extra part at the start, a missing part at the start, capitals, or a slash or encoding. A Template URL that starts with a variable, such as /{{entry.url}}, never gets this card. With Live Preview off, the Live Preview card shows first.

CheckRead
The template previews the address in its entry's URL fieldThe entry's URL field gives another address
Your environment's Base URL ends in a path, such as /enThe Base URL ends in a path
Your site redirects, or adds a language to the addressYour site redirects or adds a prefix
Your route passes Studio a fixed addressYour code passes a hardcoded address
The card says the two differ only in capitalization, or are written differentlyThe capitals, slashes or encoding differ
You came from a link, such as the Visual Editor's Open in StudioSomeone typed or pasted the address

The entry's URL field gives another address​

With the older entry URL setting, Studio opens the address in the entry's URL field, not the Template URL. To confirm it, open the entry in Contentstack, such as AI 101, and compare its URL field with the address on the card. If they match, this is your cause.

The AI 101 entry open in Contentstack, with its URL field outlined and set to /blog/ai-101.

  1. If the entry's URL field holds the right address, click Edit URL and change the Template URL to match it.
  2. Otherwise, change the entry's URL field to the address the Template URL makes, such as /blog/ai-101, and save the entry.

Which source Studio used for the Template URL is in See which source Studio used.

The Base URL ends in a path​

Your environment's Base URL ends in a path, such as /en, and Studio doesn't remove it from the address. To confirm it, open Settings > Configuration in Studio. If the Base URL ends in a path, such as https://www.example.com/en, this is your cause.

The canvas joins the Base URL and the Template URL, so a path at the end of the Base URL ends up in the address.

The canvas builds its address from three parts: the base URL http://localhost:3106 from the project's Configuration tab, with Environment local and Language English; the path /blog/ai-101 from the Blog post Template URL /blog/{{entry.slug}} filled in from AI 101; and Studio's query string. The canvas loads http://localhost:3106/blog/ai-101?cs-composable-studio=true and the rest, and your route receives it. For a template whose URL comes from the Custom Preview URL, the Alias picked in the canvas Configuration dialog gives the base URL instead.

The Configuration tab of the Blog project&#39;s settings, with Environment local, Language English - United States, Base URL http://localhost:3106 and Canvas URL /canvas.

  1. In your catch-all, app/[[...slug]]/page.tsx, take the path off before you pass url. For a language, pass it as the locale option instead.
  2. Reload the canvas. The two addresses on the card now match, and the card goes away.

How to build url is in Pass Studio only the path the Template URL describes. Where the Base URL comes from is in Check the Base URL.

Your site redirects or adds a prefix​

Your site sends the request on to another address, such as /en/blog/ai-101, before the route runs. Studio can't see the redirect, but your page reports the address it asked for. To confirm it, open the template's address in a new tab, such as http://localhost:3000/blog/ai-101. If the address bar changes to a prefixed one, this is your cause.

  1. Keep the redirect if your site needs it. A redirect to another address on your own site is fine.
  2. In your catch-all, take the prefix off before you pass url, and pass a language as the locale option. See Put the language in the address.
  3. Check the redirect keeps the query string. See Keep Studio's query string.

Your code passes a hardcoded address​

Your route passes Studio a fixed address instead of the one it was given. Only a fixed address that's close to the Template URL gets this card. To confirm it, open the route and look at url in its sdk.fetchCompositionData call. If it's a fixed text, such as "/Blog/ai-101", this is your cause.

Build url from the route's path:

// app/[[...slug]]/page.tsx
const { slug = [] } = await params;
const url = "/" + slug.join("/"); // was "/Blog/ai-101"

The capitals, slashes or encoding differ​

Studio matches addresses exactly, so capitals, a trailing or doubled slash, and encoding all count. /Blog/ai-101 doesn't match /blog/{{entry.slug}}. The card shows both, so you don't need to confirm it.

  1. If the address is right, click Edit URL and change the Template URL to match it.
  2. If the Template URL is right, fix what produces the other address. That's a link with capitals, or your catch-all adding or dropping a slash at the end.

See Studio matches the address exactly.

Someone typed or pasted the address​

The Visual Editor's Open in Studio passes the page's whole address to Studio. If your site serves it with a prefix, Studio opens the prefixed address. A link you click inside the canvas never changes the card.

  1. Compare the address in the canvas top bar with the Template URL on the card.
  2. If the address is the right one, click Edit URL and change the Template URL to match it.
  3. Otherwise, fix what adds the prefix, as in Your site redirects or adds a prefix. Then open the template from the Templates tab, not from the link. The card goes away.

The Template URL is missing or can't be used​

Code: TEMPLATE_URL_INVALID

Studio builds the canvas address from the Template URL before it loads your site. When it can't, a message fills the canvas in place of your site. Nothing is logged, because your site never loads.

The &quot;Invalid Custom URL&quot; card on the Blog post template, naming the alias and the address it made: Local by language, localhost:3000/en-us.

You seeRead
The URL is not present for this compositionThe template has no Template URL
Invalid Custom URLThe Base URL alias doesn't make a valid address

The template has no Template URL​

A freeform template has no Template URL, so the canvas shows The URL is not present for this composition.

  1. Click Edit URL in the canvas top bar.
  2. Type a Template URL that starts with /, such as /about, and save.
  3. The canvas loads your site at that address, such as http://localhost:3000/about.

See Edit or reset a Template URL.

The Base URL alias doesn't make a valid address​

The template uses a Custom Preview URL with a Base URL alias. Filled in for the entry, the alias isn't a full http or https address. The message names the alias and the address it made. It says "Check the alias in Visual Experience settings, under Preview URL > Base URL, or pick another alias in the Base URL settings."

  1. In Contentstack, open your stack's Settings > Visual Experience, then Preview URL > Base URL.

    The Base URL aliases under Preview URL in the stack&#39;s Visual Experience settings: Local, Production, and Local by language with the pattern localhost:3000/{{locale}}, which is outlined.

  2. Find the alias the message names, such as Local by language. Fix its URL so it fills in to a full address, such as http://localhost:3000/{{locale}}, or pick another alias.

If the alias leaves a variable empty, see No entry fills the URL pattern. How aliases work is in Base URL aliases.

The template opens on the canvas route​

Code: TEMPLATE_ADDRESS_IS_CANVAS_ROUTE

A setting sends the template to your Canvas URL, /canvas, where <StudioCanvas /> renders it. Editing works, but visitors to that address see nothing. The card is Use Studio Component, and it says to ask your developer. The cause is a setting you can change yourself.

Your canvas route is for sections. A template opens at its own address on your site, as URLs and routes explains.

On the left, the canvas opens http://localhost:3106/canvas with Studio's query string naming Post hero, and StudioCanvas on your route at /canvas renders the Post hero section for editing. On the right, a page your code owns fetches Post hero by its Section UID, post_hero, and renders it with no template around it.

The Use Studio Component card, scrolled to its details: StudioCanvas renders the template for the editor but doesn&#39;t serve pages, with Template UID blog_post_template, Current setup StudioCanvas, Recommended StudioComponent, and an error code starting TEMPLATE_ADDRESS_IS_CANVAS.

Inside Studio nothing is logged. Opened outside Studio, a development build logs this warning, and a production build logs nothing:

[StudioCanvas] is editing-only and renders nothing outside Studio. Mount it on a
dedicated route (the Canvas route in Studio Settings), never a wildcard.

Studio can't tell which setting it is, so check each one.

CheckRead
The template's Template URL is /canvasThe Template URL is the Canvas URL
Your environment's Base URL ends in /canvasThe Base URL points at the canvas page
The entry's URL field is /canvasThe entry's URL field is the Canvas URL

The Template URL is the Canvas URL​

The template's Template URL is the same as the Canvas URL, so Studio opens it on the canvas route.

  1. Look at the address next to Edit URL in the canvas top bar. If it's /canvas, this is your cause.
  2. Click Edit URL, and give the template its own Template URL, such as /blog/{{entry.slug}}.
  3. The canvas opens the template at its own address, such as /blog/ai-101, and the card goes away.

The Base URL points at the canvas page​

Your environment's Base URL ends in the canvas path. Only a template at / gets this card. Any other template opens at /canvas followed by its own URL, and gets This Address Is Nearly Right.

  1. Open Settings > Configuration in Studio. If the Base URL ends in /canvas, this is your cause.

  2. In Contentstack, open your stack's Settings > Environments, and set the environment's URL to your site's root, such as https://www.example.com.

    The Environments page in the stack&#39;s settings in Contentstack, listing the development environment with the URL http://localhost:3006 for English - United States.

See Check the Base URL.

The entry's URL field is the Canvas URL​

The template previews the address in its entry's URL field, and that field holds /canvas.

  1. Open the entry in Contentstack, such as AI 101. If its URL field is /canvas, this is your cause.
  2. Change the URL field to the entry's own address, such as /blog/ai-101, and save the entry.
  3. Reload the canvas. The template opens at that address.

The wrong Studio component renders it​

Code: WRONG_STUDIO_RENDERER

Templates need <StudioComponent />, and sections need <StudioCanvas />. Your route renders the wrong one, so editing works in Studio, but your live site behaves differently. For a template, the card is Use Studio Component. For a section, it's Sections Need StudioCanvas, called Use Studio Canvas Component in older Studio versions.

Sections open on your canvas route, where StudioCanvas renders them for editing. Your own pages render with StudioComponent, as URLs and routes explains.

On the left, the canvas opens http://localhost:3106/canvas with Studio's query string naming Post hero, and StudioCanvas on your route at /canvas renders the Post hero section for editing. On the right, a page your code owns fetches Post hero by its Section UID, post_hero, and renders it with no template around it.

The &quot;Use Studio Component&quot; card on the Blog post template previewing Featured, scrolled to its details for your developer, with Current setup StudioCanvas, Recommended StudioComponent, and Error code WRONG_STUDIO_RENDERER.

Opened outside Studio, a route with <StudioCanvas /> logs the editing-only warning in a development build, shown under The template opens on the canvas route. Studio can tell a template from a section, but nothing more, so check your route code.

CheckRead
Your catch-all route renders <StudioCanvas />StudioCanvas is on your catch-all route
The template's route renders both componentsThe route renders both StudioCanvas and StudioComponent
The route picks a component with isStudioCanvas()The route swaps components with isStudioCanvas()
Your site redirects Studio's requests to /canvasStudio's requests are redirected to the canvas route
<StudioCanvas /> is on an address visitors useStudioCanvas is on a path visitors use
A section is open, and the canvas route reads its UID from the addressA section renders with StudioComponent, by a UID from the address
A section is open, and the canvas route always asks for one UIDA section renders with StudioComponent, by a fixed UID

StudioCanvas is on your catch-all route​

Every address goes to <StudioCanvas />, so templates edit fine, but visitors get a blank page. An unpublished template doesn't return a 404 either.

  1. Open the component your catch-all renders, app/[[...slug]]/template-renderer.tsx. If it renders <StudioCanvas />, this is your cause.

  2. Render <StudioComponent /> with the specOptions the page fetched:

    // app/[[...slug]]/template-renderer.tsx
    "use client";

    import { StudioComponent, type StudioComponentSpecOptions } from "@contentstack/studio-react";
    import "@/studio/register-components";

    export function TemplateRenderer({ specOptions }: { specOptions: StudioComponentSpecOptions }) {
    return <StudioComponent specOptions={specOptions} />; // was <StudioCanvas />
    }
  3. Keep <StudioCanvas /> only in app/canvas/page.tsx, as Render StudioCanvas on the route shows.

The route renders both StudioCanvas and StudioComponent​

Whichever component reports to Studio last decides the card, so it flashes briefly, stays, or never shows. Your live page still renders the template.

  1. Search the template's route and the components it renders for StudioCanvas, such as in app/[[...slug]]/. If you find it, this is your cause.
  2. Remove <StudioCanvas /> there, and keep <StudioComponent />.
  3. Reload the canvas. The card stays away.

The route swaps components with isStudioCanvas()​

The route renders <StudioCanvas /> inside Studio and <StudioComponent /> outside it. Your live page works, but Studio edits the template through the section editor.

  1. Search the template's route for isStudioCanvas(). If it picks the component, this is your cause.
  2. Remove the check, and render <StudioComponent /> in both places, as in StudioCanvas is on your catch-all route.
  3. Reload the canvas. The card goes away, and the template opens in the template editor.

Studio's requests are redirected to the canvas route​

Your site sends Studio's requests to /canvas, so <StudioCanvas /> renders the template there. Your live page still works.

  1. Look in next.config.js, under redirects() and rewrites(), and in your proxy file, proxy.ts or middleware.ts. If a rule sends the template's address to /canvas, this is your cause.
  2. Remove the rule, so the template's own route answers.
  3. Reload the canvas. The address in the top bar is the template's own, such as /blog/ai-101.

StudioCanvas is on a path visitors use​

<StudioCanvas /> sits on an address your visitors open, so they get a blank page there. An unpublished template doesn't return a 404 either.

  1. Move <StudioCanvas /> to a route of its own, such as app/canvas/page.tsx. See Pick a path for the route.
  2. In Studio, open Settings > Configuration, and set Canvas URL to the same path, such as /canvas. See Set the Canvas URL to the same path.
  3. Open a section, such as Post hero. It renders on the canvas, and the old address shows your own page again.

A section renders with StudioComponent, by a UID from the address​

Every section opens in Studio, but visitors who open the canvas route get a 404. Outside Studio, the route logs the missing-identifier error, because the address has no UID. To confirm it, open app/canvas/page.tsx. If it reads a UID from the address and passes it to <StudioComponent />, replace everything in it with <StudioCanvas />, which reads the section itself:

// app/canvas/page.tsx
"use client";

import { StudioCanvas } from "@contentstack/studio-react";

export default function CanvasPage() {
return <StudioCanvas />;
}

Open a section, such as Post hero. It renders on the canvas, and the card goes away. See Mount the section preview route.

A section renders with StudioComponent, by a fixed UID​

Only that one section opens in Studio, and any visitor sees the published section at the canvas route. Opening another section shows The canvas route always shows one section. Replace the fetch and <StudioComponent /> in app/canvas/page.tsx with <StudioCanvas />, as in A section renders with StudioComponent, by a UID from the address.

Sections don't open at the Canvas URL​

Code: CANVAS_URL_INVALID

Studio opens a section at the Canvas URL in your project settings, and waits for <StudioCanvas /> there to pick it up. If no Canvas URL is set, a message fills the canvas. If nothing on the route answers, the card Studio Canvas Isn't on This Route shows after about 11 to 17 seconds. Its details name the section and the Canvas URL.

The canvas builds each address from parts: the Base URL plus a Template URL for a template, or plus the Canvas URL for a section, as URLs and routes explains.

The canvas builds its address from three parts: the base URL http://localhost:3106 from the project's Configuration tab, with Environment local and Language English; the path /blog/ai-101 from the Blog post Template URL /blog/{{entry.slug}} filled in from AI 101; and Studio's query string. The canvas loads http://localhost:3106/blog/ai-101?cs-composable-studio=true and the rest, and your route receives it. For a template whose URL comes from the Custom Preview URL, the Alias picked in the canvas Configuration dialog gives the base URL instead.

The Studio Canvas Isn&#39;t on This Route card for a section, saying Studio didn&#39;t find the Studio Canvas component at the Canvas URL. Its details show Error code CANVAS_URL_INVALID, Section post_hero, and Canvas URL /canvas.

Your site's log never mentions sections or the Canvas URL. Studio can't tell most of these apart, so check them in order.

CheckRead
Canvas URL is not configured fills the canvasThe Canvas URL isn't set
Your app has no route at the Canvas URL, and a catch-all answers itYour app has no canvas route
The route exists, but doesn't render <StudioCanvas />The canvas route has no Studio code
The card shows Currently loaded in the canvas, with a template's nameThe Canvas URL is a template's address
The Canvas URL is /The Canvas URL is your home page
The canvas shows a different section from the one you openedThe canvas route always shows one section

The Canvas URL isn't set​

You opened a section, and the project has no Canvas URL, so Canvas URL is not configured fills the canvas. Its text asks you to "configure the URL for this composition", but the missing value is the project's Canvas URL.

  1. Click Configure Canvas URL.

    The &quot;Canvas URL is not configured&quot; card on the section canvas, with the Configure Canvas URL button.

  2. Type the path of your canvas route, such as /canvas, and save.

  3. The section opens on the canvas.

See Enter the Canvas URL.

Your app has no canvas route​

Your catch-all answers the Canvas URL and fails, so the canvas shows your site's error page. Your log shows a not-found for that address. To confirm it, open the Base URL followed by the Canvas URL in a new tab, such as http://localhost:3000/canvas. If your not-found page shows, this is your cause.

  1. Create app/canvas/page.tsx with <StudioCanvas />, as in A section renders with StudioComponent, by a UID from the address. Next.js answers it before the catch-all.
  2. Or change the Canvas URL to a route that already renders <StudioCanvas />.

See Mount the section preview route.

The canvas route has no Studio code​

The route exists, but doesn't render <StudioCanvas />, so Studio gets no answer and your log stays empty.

  1. Open the route's file, such as app/canvas/page.tsx. If it has no <StudioCanvas />, this is your cause. Add it, as in A section renders with StudioComponent, by a UID from the address.
  2. If it has <StudioCanvas />, check the route loads the module that calls studioSdk.init. In the example, app/layout.tsx renders StudioInit, and app/canvas/page.tsx sits under it. See Render StudioCanvas on the route.
  3. Open a section, such as Post hero. It renders on the canvas.

The Canvas URL is a template's address​

The Canvas URL is an address a template uses, such as /about, so the About template loads there. The card names it under Currently loaded in the canvas.

  1. In Studio, open Settings > Configuration, and set Canvas URL to a path of its own, such as /canvas. Save.
  2. Check your app has a route at that path that renders <StudioCanvas />. If it doesn't, read Your app has no canvas route.
  3. Open a section, such as Post hero. It renders on the canvas.

The Canvas URL is your home page​

The Canvas URL is /, the address your visitors see first, so your home page answers it. Follow the steps in The Canvas URL is a template's address, and set Canvas URL to a path of its own, such as /canvas.

The canvas route always shows one section​

The canvas route renders <StudioComponent /> with one fixed section UID, so it shows that section whatever you open. The card doesn't name the section it shows.

  1. Search app/canvas/page.tsx for compositionUid. If it has one, this is your cause.
  2. Replace the fetch and <StudioComponent /> with <StudioCanvas />, which serves every section, as in A section renders with StudioComponent, by a UID from the address.
  3. Open two different sections. Each one renders on the canvas.

Studio can't tell why your template or section didn't load​

Code: TEMPLATE_DID_NOT_RENDER

Your template or section didn't load, and nothing Studio can see explains it. The card is Couldn't Determine the Cause. It asks a developer to check the browser console for a Studio SDK error, because "a failed lookup usually reports one there".

The Couldn&#39;t Determine the Cause card, saying your template isn&#39;t rendering at this address and Studio couldn&#39;t determine why. Its details show Error code TEMPLATE_DID_NOT_RENDER, Template UID blog_post_template, the Blog post URL /blog/{{entry.slug}}, and This page /blog/ai-101.

You seeRead
The card says your template isn't rendering at this addressA template doesn't load and Studio can't tell why
The card says your section isn't loading in StudioA section doesn't load and Studio can't tell why

A template doesn't load and Studio can't tell why​

Something on the page had your template in view, but it still didn't render. Check these in order.

  1. Look in the browser console or server log for a line starting [Contentstack Studio], and search these pages for its code.
  2. Check the address in the canvas top bar is the one you expected.
  3. Check the route for that address renders <StudioComponent />, as in Render StudioComponent in the route.
  4. If another template loaded, check your Template URL fits the address at all. See Studio matches the address exactly.
  5. Check your code doesn't remove Studio's query string from the address after the page loads, such as with history.replaceState. See Your page drops Studio's query string.

A section doesn't load and Studio can't tell why​

<StudioCanvas /> answered from the Canvas URL, but the section still didn't show. Check these in order.

  1. Look in the browser console for a line starting [Contentstack Studio], and search these pages for its code.
  2. Check the Canvas URL in Settings > Configuration is the one you expected.
  3. Check its route renders <StudioCanvas />, as in Render StudioCanvas on the route.

The template UID your code asks for isn't found​

Code: COMPOSITION_UID_NOT_FOUND

Your route fetches a template by its Template UID, compositionUid, and the stack has nothing with that UID. Inside Studio, the card is The Page Asks for a Missing Template, and its details show your template's UID. The log never says the template doesn't exist, because it can't tell a typo from an unpublished template.

The The Page Asks for a Missing Template card, saying the front-end code asks for the template ID blog_post_templat and Studio couldn&#39;t find it. Its details show Error code COMPOSITION_UID_NOT_FOUND, Template you opened blog_post_template, and ID in this route blog_post_templat.

[Contentstack Studio] COMPOSITION_UID_NOT_FOUND: No composition with the uid
"blog_post_templat" in content type "compositions".
CheckRead
The UID in your code differs from the one on the cardThe UID in your code is mistyped
The log lists "may not be published", and your live site failsThe template isn't published
The UID is right, but your site uses another stack's API keyThe UID comes from another stack

The UID in your code is mistyped​

The UID in the route doesn't match any template. Inside Studio, the card shows both UIDs, so you don't need to confirm it.

  1. Copy the template's UID from the card's details, or from Template UID in the template's Edit Template dialog.

  2. Search your app for the UID from the log, such as blog_post_templat, and replace it:

    const specOptions = await sdk.fetchCompositionData({
    compositionUid: "blog_post_template", // was "blog_post_templat"
    url,
    searchQuery,
    });

The template isn't published​

Your live site reads published content only, so an unpublished template isn't there. The log lists this cause only when published content answered. Inside Studio with Live Preview off, you see Unpublished Templates Can't Load Here instead. Deploy the template to the environment your site reads, such as production, as Deploy it shows. Then reload your live page.

The UID comes from another stack​

The log names only the UID and the content type, so a UID from another stack's project reads the same as a typo. To confirm it, compare your site's API key with the Blog stack's key under Settings > API Credentials in Contentstack. If they differ, this is your cause. Point your site at the Blog stack, as The API key is wrong shows, or use the UID of a template in the Blog project.

The template your link asks for isn't available​

Code: REQUESTED_COMPOSITION_UNAVAILABLE

A visitor's address names a template with cs-template, and that template can't be shown at this URL. Your site answers with a not-found. One message covers three causes, because Contentstack can't tell an unknown template from an unpublished one. You see this in your browser console or server log.

[Contentstack Studio] REQUESTED_COMPOSITION_UNAVAILABLE: Check that the composition
UID is correct and that it's published in this environment and locale.

Check these in order.

  1. Compare the UID in cs-template with Template UID in the template's Edit Template dialog. If they differ, fix the link.
  2. Check the template is published in this environment and language. If it isn't, deploy it from Studio, as Deploy it shows.
  3. Check the template is a secondary template of the primary template at this URL. If it isn't, deploy it as a secondary template, or open the URL without cs-template.

See Deploy the redesign as a secondary template. Your site should answer a 404 for a link it can't serve. See Answer 404 for a link you can't serve.

Only secondary templates have this URL​

Code: NO_PRIMARY_TEMPLATE_FOR_SECONDARY

A visitor's address names a secondary template with cs-template, and no primary template is published at this URL. The primary template was unpublished or deleted, or its URL changed. Your site answers with a not-found, and you see this in your browser console or server log.

[Contentstack Studio] NO_PRIMARY_TEMPLATE_FOR_SECONDARY: Templates are published at
this URL, but none of them is the primary one.

Deploy one of the secondary templates from Studio. With no primary template at its URL, it becomes the primary one. Then open the address again. It loads with and without cs-template.

See When no template is primary at the URL. Your site should answer a 404 for a link it can't serve. See Answer 404 for a link you can't serve.

No template has this address​

Code: NO_COMPOSITION_FOR_URL

Your site asked for an address, Studio checked every Template URL, and none fits it. Inside Studio, the card is Nothing Is Set Up for This Address. This Address Is Nearly Right and the Live Preview cards show before it. On your live site this is a real not-found, so a 404 is the right answer.

Studio finds a template for an address in two steps, a shortlist and an entry check, as How Studio matches an address to a template explains. This error means the shortlist came out empty: no Template URL fits the address. A template that fits but has no entry for the address is a different error, The entry isn't found.

The address /blog/ai-101 goes through two steps. In step 1, the shortlist, Featured post's /blog/featured doesn't fit, /{{entry.url}} drops out with less fixed text, and Blog post's /blog/{{entry.slug}} stays, so Blog post wins. Step 2, the entry check, runs only when more than one template stays, such as Blog post and Topic page both at /blog/{{entry.slug}}, and on your live site the template deployed most recently that has an entry wins.

The &quot;Nothing Is Set Up for This Address&quot; card for /blogs/ai-101 on the Featured post template, with an Edit Template URL button and the Template URL, /blog/featured, in its details.

[Contentstack Studio] NO_COMPOSITION_FOR_URL: No composition matches
"/blogs/ai-101". Considered 4 compositions.

If the search stopped before it finished, the code is SEARCH_INCOMPLETE instead. See Your project has more than 2,000 templates. If a Template URL fits but no entry has the address, see The entry isn't found.

CheckRead
The address, or a Template URL, is wrongNo Template URL fits the address
Your live site fails, and the log lists "may not be published"The template isn't published
The log says "Considered 0 compositions", or Studio shows Content Types Don't MatchYour site asks for the wrong content type
The address is close to one of your Template URLsThe address nearly matches a Template URL

No Template URL fits the address​

No template is set up for this address. Inside Studio, the card shows the address next to your template's Template URL.

  1. If the address is wrong, fix the link or the code that produced it, such as /blogs/ai-101 for /blog/ai-101.
  2. If the address is right, click Edit Template URL on the card, and set a Template URL that produces it. See Edit or reset a Template URL.

The template isn't published​

Your live site reads published content only, so an unpublished template isn't there. The log lists this cause last, and only when published content answered. Inside Studio with Live Preview off, you see Unpublished Templates Can't Load Here instead. Deploy the template to that environment, as Deploy it shows. Then reload your live page.

Your site asks for the wrong content type​

Your site reads templates from a content type other than the project's, so it finds none, or the wrong ones. The log never names the content type it searched. "Considered 0 compositions" is a strong sign. See Your site asks for the wrong content type.

The address nearly matches a Template URL​

The log doesn't say how close the address came. Compare the address in the log with each Template URL by hand. Look for an extra part at the start, capitals, a trailing slash or encoding. Then follow The address is nearly right.

No template is connected to this content type​

Code: NO_COMPOSITION_FOR_TEMPLATE_CONTENT_TYPE

Your route asks for the template connected to a content type, with templateContentTypeUid, and nothing in the project is connected to it. Inside Studio, the card is No Template Uses This Content Type, and it names the content type your code asked for. On your live site, the log also lists "may not be published" when published content answered.

The No Template Uses This Content Type card, saying the front-end code asks for the template connected to blog_posts and Studio couldn&#39;t find one. Its details show Error code NO_COMPOSITION_FOR_TEMPLATE_CONTENT_TYPE, Template you opened blog_post_template, and Content type the page asked for, blog_posts.

[Contentstack Studio] NO_COMPOSITION_FOR_TEMPLATE_CONTENT_TYPE: No composition is
connected to the content type "blog_posts".
  1. Compare the content type the card names with your templates' Connected Content Type, on the templates list in Studio. If the UID in your code is wrong, fix templateContentTypeUid, such as blog_post.
  2. If no template is connected to that content type yet, create one. See Create a connected template.
  3. If a connected template isn't published to that environment, deploy it, as Deploy it shows.

How a fetch by content type picks the template is in Fetch by content type.

The connected content type is gone​

Code: CONNECTED_CONTENT_TYPE_MISSING

Studio couldn't read the entries of the content type your template is connected to, so it can't open the canvas. Connected Content Type Not Available fills the canvas, saying the content type "is no longer available". Studio shows the same message whenever that request fails, not only when the content type was deleted.

The &quot;Connected Content Type Not Available&quot; card on the Blog post template&#39;s canvas, with Select Entry in the top bar.

  1. In Contentstack, open your stack's Settings > Trash. If the content type is there, such as Blog post (blog_post), this is your cause.

  2. Restore the content type. Contentstack keeps deleted items for 14 days. See About Trash.

  3. If it's not in the Trash, it's gone for good. A template's connected content type can't be changed, so create a new template connected to another content type. See Create a connected template.

  4. If the content type was never deleted, the request failed for another reason. Reload the canvas, and if it keeps happening, report it.

The language in the address isn't on your stack​

Code: URL_LOCALE_NOT_FOUND

The address asks for a language your stack doesn't have. The language came from the visitor's address, so it's a missing template, and a 404 is the right answer. Inside Studio, the card is Nothing Is Set Up for This Address, and it names the language. With Live Preview off, the Live Preview card shows first.

The Nothing Is Set Up for This Address card, saying /fr/blog/ai-101 asks for the language fr and that language isn&#39;t set up on the stack. Its details show Error code URL_LOCALE_NOT_FOUND, This page /fr/blog/ai-101, and Language fr.

[Contentstack Studio] URL_LOCALE_NOT_FOUND: "/fr/blog/ai-101" asks for the language
"fr", which is not set up on this stack.
CheckRead
The Template URL starts with {{locale}}The Template URL has a language variable
Your router passes the language with each fetch, as the locale optionYour router passes the language

If the language came from your SDK setup instead, see The language is wrong.

The Template URL has a language variable​

The Template URL is /{{locale}}/blog/{{entry.slug}}, so the language in the address picks the content. The stack has en-us and fr-fr, so fr isn't one of its languages. To confirm it, look for the language under your stack's Settings > Languages in Contentstack.

  1. If the language should exist, add it, as Add a language shows.
  2. If a visitor mistyped the address, there's nothing to fix, because the 404 is right.

Your router passes the language​

Your router takes the language from the address and passes it with the fetch. Today's SDK treats it as a setup error, LOCALE_NOT_CONFIGURED, and the card is This Language Isn't Set Up. The next SDK reports it as a missing template instead:

[Contentstack Studio] URL_LOCALE_NOT_FOUND: The language "fr" passed with this
fetch is not set up on this stack.
  1. If the language should exist, add it to the stack, as Add a language shows.
  2. Otherwise, make your router pass only languages the stack has, and answer other addresses with a 404. See Put the language in the address.

A template's layout can't be read​

Code: SPEC_UNREADABLE

Studio found the template or section, but its stored layout is damaged and won't open. It isn't anything you did, and it isn't a version mismatch. Inside Studio, the card is Your Content Didn't Load. Don't answer it with a 404, because the template exists. A damaged section placed in a template is skipped with a warning, and the template still renders. Nothing in your project fixes it, so report it with the log line.

[Contentstack Studio] SPEC_UNREADABLE: The stored layout for blog_post_template
could not be read.
[Contentstack Studio] Skipping section post_hero: its stored layout could not be read.

The template you opened doesn't exist​

Code: OPENED_COMPOSITION_NOT_FOUND

Studio couldn't fetch the template in the editor's address, so Composition Not Found fills the screen. The template was deleted, or the link is wrong. Studio shows the same screen whenever fetching the template fails. Click Go to Compositions, then open the template from the list. See Rename or delete a template or section.

The Composition Not Found page, with its Go to Compositions button.

Still stuck​

Use Copy diagnosis on the card, or copy the log line, and paste it into your AI assistant or a support ticket.

Report a problem with this page