添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

let newPage: PageNode = figma.createPage();


Error:


vendor-core-67cd853d…3a53b1.min.js.br:15 Syntax error on line 36: Unexpected token :
let newPage: PageNode = figma.createPage();

package.json


"scripts": {
"build": "tsc -p tsconfig.json",
"lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .",
"lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .",
"watch": "npm run build -- --watch"

What is going on here?

Page 1 / 1

I don’t know I this helps in any way - but I was getting the same error. For me it turned out that Figma plugins (on Sonoma 14.5, Figma 124.2.8 no longer likes console logs. When I removed them - that error removed and all ran as expected. May not be the same issue though.

edDes:
vendor-core-67cd853d…3a53b1.min.js.br:15 Syntax error on line 36: Unexpected token :
let newPage: PageNode = figma.createPage();

You are feeding it raw TS code but you need to compile it first. Make sure your manifest points to a .js file not a .ts file. And that js file needs to be compiled using the build command.

Correct, fixed, and thanks to @Gleb.


I am not sure where this code.ts came from in the manifest, but changing it solved the issue.

Scanning file for viruses.

Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.

This file cannot be downloaded

Sorry, our virus scanner detected that this file isn't safe to download.