Closed jkevingutierrez closed 4 months ago
@jkevingutierrez would you be able to share your tsconfig.json
?
I think you'll want something like:
{
"compilerOptions": {
"lib": ["ESNext"], // Explicitly don't include DOM since the plugin code is running in Figma's JS runtime and not the browser directly
"types": ["@figma/plugin-typings"]
}
}
Yep, I have something similar.
This is my tsconfig.json
{
"compilerOptions": {
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"pretty": true,
"sourceMap": true,
"strict": true,
"target": "es2018",
"baseUrl": "./",
"moduleResolution": "node",
"module": "ESNext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"outDir": "dist",
"typeRoots": [
"./node_modules/@types",
"./node_modules/@figma"
]
},
"exclude": [
"node_modules"
],
"include": [
"./src/**/*.ts",
"./*.ts"
]
}
@jkevingutierrez Updating your tsconfig to:
{
"compilerOptions": {
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"pretty": true,
"sourceMap": true,
"strict": true,
"target": "es2018",
"baseUrl": "./",
"moduleResolution": "node",
"module": "ESNext",
"lib": ["esnext"],
"outDir": "dist",
"typeRoots": [
"./node_modules/@types",
"./node_modules/@figma"
]
},
"exclude": [
"node_modules"
],
"include": [
"./src/**/*.ts",
"./*.ts"
]
}
should resolve the issue! LMK if it works!
I'm going to close this due to inactivity. @jkevingutierrez please feel free to re-open this or create a new issue if the above didn't work
I'm getting a couple of issues when I run tsc using this package:
Cannot augment module 'console' with value exports because it resolves to a non-module entity.
Cannot redeclare block-scoped variable 'fetch'.