Skip to content

Request failed with status code 400 #152

@ricovitch

Description

@ricovitch

Hello,

I'm testing figma export cli, in the goal of exporting svgs from figma file.
I created a Personal Access Token, and checked that using it through curl commands works fine.

But the same thing does not work through @figma-export/cli
I get the following error whatever the configuration I use

✖ fetching document
Error: while fetching file "tGSuhDDoppmJXa8Y5Pinq8": Request failed with status code 400
at /Users/helier_e/Dev/tests/figma/figma-export-cli/node_modules/@figma-export/core/dist/lib/export-components.js:21:15
at processTicksAndRejections (node:internal/process/task_queues:96:5)

I use this npm script : dotenv figma-export use-config
With an .env file providing FIGMA_TOKEN, and the following .figmaexportrc.js file content

module.exports = {
  commands: [
    [
      "components",
      {
        fileId: "tGSuhDDoppmJXa8Y5Pinq8",
        outputters: [
          require("@figma-export/output-components-as-svg")({
            output: "./dist/svg",
          }),
        ],
      },
    ],
  ],
};

Any hint on how I can debug this ?
I'm operating through a corporate proxy, but curl commands work (I have HTTP_PROXY and HTTPS_PROXY env vars defined)
I thing it uses axios internally, that should also take into account HTTP_PROXY env vars.

Am I missing something ? Or how can I debug the error further ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: dependenciesNeed to update one or more dependencies

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions