quasarframework/quasar · warning

render() - cannot locate ${templatePath}. Skipping...

Error message

render() - cannot locate ${templatePath}. Skipping...

What it means

api.render(templatePath, scope) copies a template FOLDER from the extension into the app. This warning means the resolved path (relative to the file calling render()) does not exist on disk, so the render is skipped. Paths are resolved against the caller's directory, not the app root or extension package root.

Source

Thrown at app-vite/lib/app-extension/api-classes/InstallAPI.js:252

        warn()
      }
    }
  }

  /**
   * Render a folder from extension templates into devland.
   * Needs a path (to a folder) relative to the path of the file where render() is called
   *
   * @param {string} templatePath (relative path to folder to render in app)
   * @param {object} scope (optional; rendering scope variables)
   */
  render(templatePath, scope) {
    const dir = getCallerPath(1)
    const source = path.resolve(dir, templatePath)
    const rawCopy = !scope || Object.keys(scope).length === 0

    if (!fs.existsSync(source)) {
      this.logger.warn(`render() - cannot locate ${templatePath}. Skipping...`)
      return
    }
    if (!fs.lstatSync(source).isDirectory()) {
      this.logger.warn(
        `render() - "${templatePath}" is a file instead of folder. Skipping...`
      )
      return
    }

    this.#hooks.renderFolders.push({
      source,
      rawCopy,
      scope
    })
  }

  /**
   * Render a file from extension template into devland

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Fix the templatePath so it is relative to the file that calls api.render() (use './'-style relative paths).
  2. Verify the template folder exists in the installed extension under node_modules and is included in the package files.
  3. If the extension is yours, add the template folder to package.json 'files' and republish.
  4. Re-run 'quasar ext' after fixing; check the resolved location with getCallerPath semantics.

Example fix

// before: assumes app-root-relative path
api.render('src/quasar/templates', { someVar: 1 })
// after: relative to the install script file
api.render('./template', { someVar: 1 })
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const path = require('path');
const src = path.resolve(__dirname, templatePath);
if (!fs.existsSync(src)) throw new Error(`template folder missing: ${src}`);
if (!fs.statSync(src).isDirectory()) throw new Error(`not a folder: ${src}`);
api.render(templatePath, scope);

Type guard

function isTemplateFolder(baseDir, p) {
  const fs = require('fs');
  const full = require('path').resolve(baseDir, p);
  return fs.existsSync(full) && fs.statSync(full).isDirectory();
}

Prevention

When it happens

Trigger: api.render('src/template', scope) where path.resolve(getCallerPath(), templatePath) doesn't exist — typo in the folder name, template folder missing from the published extension package, or path given as app-relative instead of caller-relative.

Common situations: Extension published without the template folder (missing from package.json files list / npmignore), renamed template directory, or author assuming paths resolve from the extension root instead of the install-script file location.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/b5d7edccc4439e20. Report an issue: GitHub.