Unable to set figma file location during interactive setup
Hey team,
I'm getting an issue when using the interactive setup. Currently, whenever I get to the following step, it throws an error no-matter what input I provide (a valid directory path or hit enter for co-location)
What directory should Code Connect files be created in? (Press enter to co-locate your files alongside your component files)
Below is the full stack trace:-
? What directory should Code Connect files be created in? (Press enter to co-locate your files alongside your component files) › node:internal/readline/emitKeypressEvents:74
throw err;
^
TypeError: Cannot read properties of undefined (reading 'disabled')
at SelectPrompt.submit (<REDACTED_PATH>/node_modules/prompts/lib/elements/select.js:68:25)
at ReadStream.keypress (<REDACTED_PATH>/node_modules/prompts/lib/elements/prompt.js:32:16)
at ReadStream.emit (node:events:530:35)
at emitKeys (node:internal/readline/utils:371:14)
at emitKeys.next (<anonymous>)
at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)
at ReadStream.emit (node:events:530:35)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
Node.js v20.18.1
It looks like an error is being thrown for the CLI prompt, but would appreciate any assistance if this is a user error.
I have added --verbose flag with the above error thrown.
thanks!
- Code Connect CLI version
- 1.2.4
- Operating system
- macOS 15.2 (24C101)
Hey team, any update on this? thanks.
Hi @AndyJPhillips-lively. I can't seem to replicate this with the same Node and Code Connect version installed. Do you mind updating to the latest version of Code Connect to see if that changes anything for you?
I'm running into the same problem as @AndyJPhillips-lively - here's my call stack (after pressing "enter" to accept the default)
A Code Connect file is created for each Figma component to code definition match. ? In which directory would you like to store Code Connect files? (Press enter to co-locate your files alongside your component files) › node:internal/readline/emitKeypressEvents:74 throw err; ^
TypeError: Cannot read properties of undefined (reading 'disabled')
at SelectPrompt.submit (Redacted.nvm/versions/node/v23.9.0/lib/node_modules/@figma/code-connect/node_modules/prompts/lib/elements/select.js:68:25)
at ReadStream.keypress (Redacted.nvm/versions/node/v23.9.0/lib/node_modules/@figma/code-connect/node_modules/prompts/lib/elements/prompt.js:32:16)
at ReadStream.emit (node:events:519:35)
at emitKeys (node:internal/readline/utils:370:14)
at emitKeys.next (
- Code Connect CLI version : 1.3.1
- OS : MacOS 15.3.1
- Node version : 23.9.0
Hey @rgullyfigma, I have updated to the latest, but still no luck. I did a little bit of debugging and was able to pin it down to failing on the following line at @figma/code-connect/dist/connect/wizard/run_wizard.js :-
const answers = await (0, prompts_1.default)(question); line 141
Based on the error, I would assume that the prompts package is assuming this question is a select (which obviously isn't the case). I looked at the args you are passing in and it looks correct. The only other thing I can think of is that it the version of prompts might not be compatible. Could you provide me with your version of prompts and see if that get's me up and running?
Alternatively, is there a way I can get setup without going through this process? thanks.
@AndyJPhillips-lively I'll make the team aware of this issue and hopefully we can have a fix for this shortly. In the meantime you should be able to create the figma.connect() files manually and then using the npx figma connect publish command to avoid needing the wizard.
fwiw, noticed that the CLI has been updated to 1.3.2 (here, but not here), so thought I would give it another try. Unfortunately, I'm still seeing the same "Cannot read properties of undefined (reading 'disabled')" issue.
Running into this issue as well. Since the interactive settings are all defaulted when running into this issue, I feel like this should be a high priority task.
-
node:20.10.0 -
@figma/code-connect:1.3.4(latest)