rematocorp / trello-integration-action

GitHub action for connecting GitHub PRs and Trello cards — moves cards, adds labels & people, and more
MIT License
18 stars 11 forks source link

Fix axios import #47

Closed marek-saji closed 1 year ago

marek-saji commented 1 year ago
Checklist

Problem

After forking off this repository just running yarn build changed dist/index.js and action was failing with:

TypeError: node_modules_axios_namespaceObject.put is not a function

(Example run: https://github.com/verkstedt/trello-hearts-github/actions/runs/5038140463/jobs/9035426932?pr=8)

I ran yarn build with Node v16.18.1 (chose 16.x, since action.yml has using: node16).

Solution

I fixed this by changing import * as axios from 'axios' in index.js to import axios from 'axios'. I hope this change doesn’t break anything on your side, since obviously building works different for you for whatever reason. :confused:

I also added .nvmrc with v16 for nvm (and other Node.js version switchers).

(Example run: https://github.com/verkstedt/trello-hearts-github/actions/runs/5038183524/jobs/9035496053?pr=8)

Btw. after running yarn build there were more changes than I expected in dist/index.js — maybe it wasn’t run on latest changes on main?