Figma Support Forum

Cannot find name __uiFiles__

What am I doing wrong?

manifest.json

  "ui": {
    "main": "index.html",
    "secondary": "secondary.html"
  }
  "menu": [
    {"name": "main", "command": "main"},
    {"name": "secondary", "command": "secondary"}
]

code.js
if (command === 'main') figma.showUI(__uiFiles__.main, {width: 600, height: 400});

terminal:

src/main/code.ts(4,38): error TS2304: Cannot find name '__uiFiles__'.
TypeScript: 1 semantic error

I think you might be using an old version of the typings file where this property didn’t exist yet. Update your typings: @figma/plugin-typings - npm

npm i @figma/plugin-typings

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend-boilerplate@1.0.0 dev: `gulp`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frontend-boilerplate@1.0.0 dev script.

I don’t know what this error means, maybe you need to use gulp instead of npm?

Also I found this by googling the error message: node.js - How to solve npm error "npm ERR! code ELIFECYCLE" - Stack Overflow maybe you can find something else if you google it. But this doesn’t seem to be related to the typings, more like a local issue with your environment.

Thanks :+1: