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

Cannot build #1143

Closed
alinco8 opened this issue May 14, 2024 · 6 comments · Fixed by #1146
Closed

Cannot build #1143

alinco8 opened this issue May 14, 2024 · 6 comments · Fixed by #1146
Assignees
Labels
*awaiting-response 🔨 dev Related to the development of the project itself

Comments

@alinco8
Copy link

alinco8 commented May 14, 2024

MacBookAir Sonoma 14.4.1
Node: v20.7.0
Npm: 10.2.3

git clone https://github.com/SpyglassMC/Spyglass.git
cd Spyglass
npm i && npm run build

Error:

npm WARN skipping integrity check for git dependency ssh://[email protected]/SPGoding/vanilla-datapack.git 

added 955 packages, and audited 979 packages in 26s

144 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (3 low, 4 moderate, 7 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> @spyglassmc/[email protected] build
> wireit

✅ [packages/locales:build] Already fresh
🏃 [build:packages] Running command "tsc -b packages"
✅ [build:packages] Executed successfully
🏃 [packages/vscode-extension:build] Running command "node esbuild.mjs prod"
🏃 [packages/playground:build] Running command "node esbuild.js prod"
Start building...
Start building...
Built successfully.
✅ [packages/playground:build] Executed successfully
✘ [ERROR] No loader is configured for ".node" files: ../../node_modules/fsevents/fsevents.node

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

Error: Build failed with 1 error:
../../node_modules/fsevents/fsevents.js:13:23: ERROR: No loader is configured for ".node" files: ../../node_modules/fsevents/fsevents.node
    at failureErrorWithLog (/Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:1636:15)
    at /Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:1048:25
    at /Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:993:52
    at buildResponseToResult (/Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:1046:7)
    at /Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:1075:16
    at responseCallbacks.<computed> (/Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/Users/ali/Desktop/Spyglass/Spyglass/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:343:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: [Object],
      notes: [],
      pluginName: '',
      text: 'No loader is configured for ".node" files: ../../node_modules/fsevents/fsevents.node'
    }
  ],
  warnings: []
}
❌ [packages/vscode-extension:build] Failed with exit status 1
@SPGoding
Copy link
Member

SPGoding commented May 14, 2024

If I understand correctly fsevents is a native extension provided by Node.js on MacOS and should not be bundled. Could you please try again with the macos-build-fix branch and let me know if the issue persists?

SPGoding added a commit that referenced this issue May 14, 2024
SPGoding added a commit that referenced this issue May 14, 2024
@SPGoding SPGoding added 🔨 dev Related to the development of the project itself *awaiting-response and removed *cannot reproduce labels May 14, 2024
@SPGoding SPGoding self-assigned this May 14, 2024
@SPGoding
Copy link
Member

Just a follow up, have you gotten a chance to try if the attempted fix in #1146 solves this issue for you?

@alinco8
Copy link
Author

alinco8 commented Jun 3, 2024

@SPGoding
Sorry! I was busy and couldn't reply...
npm run build
log

$ wireit
⚠️ Wireit could not identify the npm user agent, assuming it behaves like npm. Arguments may not be interpreted correctly.
🏃 [packages/locales:build] Running command "node ./build.js"
✅ [packages/locales:build] Executed successfully
🏃 [build:packages] Running command "tsc -b packages"
✅ [build:packages] Executed successfully
🏃 [packages/playground:build] Running command "node esbuild.js prod"
🏃 [packages/vscode-extension:build] Running command "node esbuild.mjs prod"
Start building...
Start building...
Built successfully.
✅ [packages/playground:build] Executed successfully
Built successfully.
✅ [packages/vscode-extension:build] Executed successfully
✅ [build] No command to execute

The build was successful! Thank you so much!
This is supreme extension!!

@alinco8
Copy link
Author

alinco8 commented Jun 3, 2024

When i run Launch Client from the Run And Debug menu or press F5, it shows:

 *  Executing task: pnpm run watch 

 WARN  Issue while reading "/Users/ali/Desktop/SpyglassMC/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
 WARN  The "workspaces" field in package.json is not supported by pnpm. Create a "pnpm-workspace.yaml" file instead.

> @spyglassmc/[email protected] watch /Users/ali/Desktop/SpyglassMC
> npm run build:dev --watch

Error: Failed to replace env in config: ${NPM_TOKEN}
    at /usr/local/lib/node_modules/npm/lib/config/core.js:415:13
    at String.replace (<anonymous>)
    at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:411:12)
    at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:389:7)
    at /usr/local/lib/node_modules/npm/lib/config/core.js:330:24
    at Array.forEach (<anonymous>)
    at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:328:23)
    at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)
    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:316:10)
    at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16
/usr/local/lib/node_modules/npm/lib/npm.js:59
      throw new Error('npm.load() required')
      ^

Error: npm.load() required
    at Object.get (/usr/local/lib/node_modules/npm/lib/npm.js:59:13)
    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:208:32)
    at process.emit (node:events:520:28)
    at process._fatalException (node:internal/process/execution:191:25)

Node.js v22.2.0
 ELIFECYCLE  Command failed with exit code 7.

 *  The terminal process "/bin/zsh '-l', '-c', 'pnpm run watch'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

and the process terminates.

@alinco8
Copy link
Author

alinco8 commented Jun 3, 2024

I deleted //registry.npmjs.org/:_authToken=${NPM_TOKEN} in .npmrc and its worked!

@SPGoding
Copy link
Member

SPGoding commented Jun 7, 2024

I don't quite remember why that was added as I don't recall this repo using private packages, but glad that worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*awaiting-response 🔨 dev Related to the development of the project itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants