Skip to content

Diagnostic reference

No HTML file named X was found

Why createHtmlOutputFromFile and createTemplateFromFile cannot find an HTML file, and how to match the name to the file in the project.

Updated October 18, 2026

Apps Script error

Exception: No HTML file named sidebar was found.

What it means

HtmlService.createHtmlOutputFromFile and createTemplateFromFile look up an HTML file in the project by the name you pass. The name must match a file in the editor's Files list, including capital letters, without the .html extension the list shows. A file listed as Sidebar.html is passed as 'Sidebar'. A misspelled name, a file renamed after the code was written, or a file created as a script file instead of an HTML file all produce this error. An include helper that loads other HTML files fails the same way when one of its names is wrong.

Before and after

The code before and after the fix.

Problem 1 changed line
// The project has an HTML file named Sidebar.
function showSettingsSidebar() {
  const html = HtmlService.createHtmlOutputFromFile('sidebar').setTitle('Settings');
  SpreadsheetApp.getUi().showSidebar(html);
}
Fixed 1 changed line
// The project has an HTML file named Sidebar.
function showSettingsSidebar() {
  const html = HtmlService.createHtmlOutputFromFile('Sidebar').setTitle('Settings');
  SpreadsheetApp.getUi().showSidebar(html);
}

How to fix it

  • Copy the file name from the Files list with the same capital letters, and leave off .html.
  • Create HTML files with Add a file, then HTML, so they get the HTML file type.
  • Check every name passed to an include helper the same way.

Things to check

  • Fixing the name does not fix scriptlets. A file with scriptlets needs createTemplateFromFile and evaluate().
  • myFunction does not create or rename project files.