sapphiredev / type Goto Github PK
View Code? Open in Web Editor NEWA type detection utility for JavaScript
Home Page: https://www.sapphirejs.dev/
License: MIT License
A type detection utility for JavaScript
Home Page: https://www.sapphirejs.dev/
License: MIT License
The prebuilt binaries do not include musl 1.2.4, which is used by Alpine 3.18. I believe this was just recently released (start of June if I'm correct) so that's why there is no prebuilt for musl (last release of this package was on April).
I checked #429 and the solution seems to be to use Yarn, but it didn't mention that it required Python to be installed in the Docker image. I had to add the following line to my Dockerfile as suggested here:
RUN apk add --no-cache libc6-compat python3 build-base gcc
Prebuilt binaries for musl 1.2.4 in releases would prevent users from having to install Python into the Docker build image.
I know I can use multi-stage builds to remove Python from the final image -- I'm using that for my image. But having the prebuilt for musl could reduce build times.
Building manually works with Yarn and Python installed in the Docker build image.
Here's the log generated from the failed build by node-pre-gyp when I didn't have Python installed, just in case it is needed:
# This file contains the result of Yarn building a package (@sapphire/type@npm:2.4.0)
# Script name: install
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp info check checked for "/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4/type.node" (not found)
node-pre-gyp http GET https://github.com/sapphiredev/type/releases/download/v2.4.0/type-v2.4.0-node-v108-linux-x64-musl-1.2.4.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/sapphiredev/type/releases/download/v2.4.0/type-v2.4.0-node-v108-linux-x64-musl-1.2.4.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for @sapphire/[email protected] and [email protected] (node-v108 ABI, musl) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/sapphiredev/type/releases/download/v2.4.0/type-v2.4.0-node-v108-linux-x64-musl-1.2.4.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (/app/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack at PythonFinder.runChecks (/app/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack at PythonFinder.<anonymous> (/app/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack at PythonFinder.execFileCallback (/app/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack at exithandler (node:child_process:427:5)
gyp ERR! stack at ChildProcess.errorhandler (node:child_process:439:5)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Linux 5.15.90.1-microsoft-standard-WSL2
gyp ERR! command "/usr/local/bin/node" "/app/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4/type.node" "--module_name=type" "--module_path=/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
gyp ERR! cwd /app/node_modules/@sapphire/type
gyp ERR! node -v v18.16.1
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4/type.node --module_name=type --module_path=/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/app/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Linux 5.15.90.1-microsoft-standard-WSL2
node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/@discordjs/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /app/node_modules/@sapphire/type
node-pre-gyp ERR! node -v v18.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.4.5
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4/type.node --module_name=type --module_path=/app/node_modules/@sapphire/type/prebuild/type-node-v108-linux-x64-musl-1.2.4 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)
Only seems to happen when requiring discord.js and evaluating the output of it using the Type class. So I doubt you would want to fix it. Just thought I'd make a bug report just in case.
Example code includes
const { Type } = require('@sapphire/type');
const DJS = require('discord.js');
const output = new Type(DJS);
output.toString();
Will cause the error.
TypeError: Cannot read properties of null (reading 'name')
at Function.resolve (/opt/stratobotelite/node_modules/@sapphire/type/src/lib/index.ts:152:2)
at new Type (/opt/stratobotelite/node_modules/@sapphire/type/src/lib/index.ts:60:13)
at _Type.addValue (/opt/stratobotelite/node_modules/@sapphire/type/src/lib/index.ts:102:25)
at _Type.addEntry (/opt/stratobotelite/node_modules/@sapphire/type/src/lib/index.ts:112:30)
at _Type.check (/opt/stratobotelite/node_modules/@sapphire/type/src/lib/index.ts:134:2)
at _Type.toString (/opt/stratobotelite/node_modules/@sapphire/type/src/lib/index.ts:77:7)
at Function.codeBlock (/opt/stratobotelite/src/frameworks/klasa/lib/util/util.js:41:42)
at module.exports.run (/opt/stratobotelite/src/bot/commands/Admin/eval.js:138:23)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async module.exports.runCommand (/opt/stratobotelite/src/bot/monitors/commandHandler.js:75:23)
const { Type } = require('@sapphire/type');
const DJS = require('discord.js');
const output = new Type(DJS);
output.toString();
Wasn't expected to error.
No response
System:
OS: Linux 4.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (4) x64 Intel Core Processor (Haswell, no TSX)
Memory: 6.34 GB / 7.60 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 21.7.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.5.0 - /usr/local/bin/npm
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
@vitest/coverage-v8
, vitest
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.github/workflows/auto-deprecate.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/ci-build-and-test.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/checkout v4
actions/setup-node v4
actions/checkout v4
.github/workflows/ci-lint-and-docs.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/setup-node v4
.github/workflows/codeql-analysis.yml
actions/checkout v4
github/codeql-action v3
github/codeql-action v3
.github/workflows/continuous-delivery.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/deprecate-on-merge.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/documentation.yml
actions/checkout v4
actions/setup-node v4
actions/upload-artifact v4
actions/checkout v4
actions/setup-node v4
actions/download-artifact v4
actions/checkout v4
nick-fields/retry v3
.github/workflows/labelsync.yml
actions/checkout v4
crazy-max/ghaction-github-labeler v5
.github/workflows/manual-asset-updater.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/checkout v4
actions/setup-node v4
actions/checkout v4
.github/workflows/publish.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/release-updater.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/checkout v4
actions/setup-node v4
actions/checkout v4
kludge-cs/gitcord-release-changelogger v3.0.0@5592170408dc081d7cb6a74ce025911bd1fcb7c3
package.json
@discordjs/node-pre-gyp ^0.4.5
nan ^2.20.0
tslib ^2.6.3
@actions/core ^1.10.1
@actions/github ^6.0.0
@actions/glob ^0.4.0
@commitlint/cli ^19.3.0
@commitlint/config-conventional ^19.2.2
@favware/cliff-jumper ^4.0.2
@favware/npm-deprecate ^1.0.7
@sapphire/eslint-config ^5.0.5
@sapphire/prettier-config ^2.0.0
@sapphire/ts-config ^5.0.1
@types/node ^20.14.10
@vitest/coverage-v8 ^2.0.2
cz-conventional-changelog ^3.3.0
discord.js ^14.15.3
eslint ^8.57.0
eslint-config-prettier ^9.1.0
eslint-plugin-prettier ^5.1.3
lint-staged ^15.2.7
prettier ^3.3.3
tsup ^8.1.0
vite ^5.3.3
vitest ^2.0.2
ansi-regex ^5.0.1
minimist ^1.2.8
yarn 4.3.1
The prebuilt binaries released do not include ones for glibc 2.28, which is used in AlmaLinux 8.7 (CentOS replacement). Therefore, Sapphire cannot run on an AlmaLinux 8.7 system without manually building it (which is very tedious considering this package is often a dependency and used within a package manager, which fails because it could not find a prebuilt for glibc 2.28 to download).
Prebuilt binaries for glibc 2.28 in releases.
Building manually; very tedious and not worth the amount of effort necessary, especially for every new release.
Using a different version of glibc; also very tedious when AlmaLinux is basically set to use 2.28 by default. Even AlmaLinux 9 uses 2.34, which is also not included in prebuilt binaries.
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.