quasarframework/quasar · warning

renderFile() - "${relativeSourcePath}" is a folder instead o

Error message

renderFile() - "${relativeSourcePath}" is a folder instead of a file. Skipping...

What it means

api.renderFile() renders a single FILE; this warning fires when the resolved source path exists but is a DIRECTORY. The call is skipped — use api.render() for folders.

Source

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

   *
   * @param {string} relativeSourcePath (file path relative to the folder from which the install script is called)
   * @param {string} relativeTargetPath (file path relative to the root of the app -- including filename!)
   * @param {object} scope (optional; rendering scope variables)
   */
  renderFile(relativeSourcePath, relativeTargetPath, scope) {
    const dir = getCallerPath(1)
    const sourcePath = path.resolve(dir, relativeSourcePath)
    const targetPath = this.resolve.app(relativeTargetPath)
    const rawCopy = !scope || Object.keys(scope).length === 0

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

    this.#hooks.renderFiles.push({
      sourcePath,
      targetPath,
      rawCopy,
      scope,
      overwritePrompt: true
    })
  }

  /**
   * Add a message to be printed after App CLI finishes up install.
   *
   * @param {string} msg

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Use api.render(templatePath, scope) for directories.
  2. Point relativeSourcePath at the specific file inside the folder.
  3. Check for typos where a directory name was given instead of a filename.

Example fix

// before
api.renderFile('./templates', 'src/templates')
// after: render the whole folder
api.render('./templates')
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const path = require('path');
const src = path.resolve(__dirname, relativeSourcePath);
if (fs.existsSync(src) && fs.statSync(src).isDirectory()) {
  api.render(relativeSourcePath, scope);
} else {
  api.renderFile(relativeSourcePath, relativeTargetPath, scope);
}

Type guard

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

Prevention

When it happens

Trigger: api.renderFile('./templates', 'src/templates') where './templates' resolves to an existing directory instead of a file.

Common situations: Extension author passing a folder path to renderFile(); trailing-slash or shorthand paths that point at directories.

Related errors


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