Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix build of cli package on OSX machines #187

Merged
merged 4 commits into from
Feb 24, 2022
Merged

chore: fix build of cli package on OSX machines #187

merged 4 commits into from
Feb 24, 2022

Conversation

svenjacobs
Copy link
Contributor

Trying to build this project on my computer (macOS 12.2.1, Node 16.14, pnpm 6.31.0) I get the following error for packages/cli:

> @typesafe-i18n/cli@ build /Users/sven/Dev/Projects/Personal/typesafe-i18n/packages/cli
> tsm esbuild.ts

(node:50854) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:50854) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
✘ [ERROR] No loader is configured for ".node" files: ../../node_modules/.pnpm/fsevents@2.3.2/node_modules/fsevents/fsevents.node

    ../../node_modules/.pnpm/fsevents@2.3.2/node_modules/fsevents/fsevents.js:13:23:
      13 │ const Native = require("./fsevents.node");
         ╵                        ~~~~~~~~~~~~~~~~~

 ELIFECYCLE  Command failed with exit code 1.

According to this comment of the esbuild project, a custom plugin needs to be added.

In this PR, I added the missing plugin. I also added a .nvmrc so that maintainers (that hopefully use nvm) are using the correct Node version.

packages/cli/native-node-modules-plugin.ts Outdated Show resolved Hide resolved
packages/cli/native-node-modules-plugin.ts Show resolved Hide resolved
packages/cli/esbuild.ts Show resolved Hide resolved
@ivanhofer
Copy link
Owner

@svenjacobs thanks for investigating and creating this PR.
I'm using volta in favour over nvm so I added a commit that locks the version down also for volta users.

Co-authored-by: Hofer Ivan <ivan.hofer@outlook.com>
@ivanhofer ivanhofer changed the title [fix] Fix build chore: fix build of cli package Feb 24, 2022
@ivanhofer ivanhofer changed the title chore: fix build of cli package chore: fix build of cli package on OSX machines Feb 24, 2022
@ivanhofer ivanhofer merged commit 5879240 into ivanhofer:main Feb 24, 2022
@svenjacobs svenjacobs deleted the fix-build branch February 24, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants