yuanqing / figma-plugins

:fire: Monorepo for my Figma plugins
https://figma.com/@yuanqing
MIT License
239 stars 32 forks source link

build error #36

Closed endquote closed 2 years ago

endquote commented 2 years ago

I'm unable to build from a fresh clone under node v16.13.0.

figma-format-currency: $ node --loader ts-node/esm scripts/generate-currencies-ts.ts > src/utilities/data/currencies.ts && eslint --fix src/utilities/data/currencies.ts
figma-format-currency: (node:36270) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
figma-format-currency: (Use `node --trace-warnings ...` to show where the warning was created)
figma-format-currency: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/jsantangelo/Source/figma-plugins/packages/figma-format-currency/scripts/generate-currencies-ts.ts
figma-format-currency:     at new NodeError (node:internal/errors:371:5)
figma-format-currency:     at Object.file: (node:internal/modules/esm/get_format:72:15)
figma-format-currency:     at defaultGetFormat (node:internal/modules/esm/get_format:85:38)
figma-format-currency:     at defaultLoad (node:internal/modules/esm/load:13:42)
figma-format-currency:     at ESMLoader.load (node:internal/modules/esm/loader:303:26)
figma-format-currency:     at ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:58)
figma-format-currency:     at new ModuleJob (node:internal/modules/esm/module_job:63:26)
figma-format-currency:     at ESMLoader.getModuleJob (node:internal/modules/esm/loader:244:11)
figma-format-currency:     at async Promise.all (index 0)
figma-format-currency:     at async ESMLoader.import (node:internal/modules/esm/loader:281:24) {
figma-format-currency:   code: 'ERR_UNKNOWN_FILE_EXTENSION'
figma-format-currency: }
figma-format-currency: error Command failed with exit code 1.
figma-format-currency: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
figma-format-currency: error Command failed with exit code 1.
figma-format-currency: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build exited 1 in 'figma-format-currency'
yuanqing commented 2 years ago

Potentially some incompatibility with v16. Build works on node v14 locally for me and in CI

yuanqing commented 2 years ago

Build should work on v16 now after swapping out ts-node for tsm

endquote commented 2 years ago

Thanks! I was just using LTS. It did work using 14.18.1, then did another pull and it works with 16.13.0.

If you do want to specify a specific version, you could include an .nvmrc file.

Thanks again!