Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"publint": "publint ."
},
"dependencies": {
"@emnapi/core": "1.11.0",
"@emnapi/runtime": "1.11.0",
"@emnapi/core": "1.11.1",
"@emnapi/runtime": "1.11.1",
"@napi-rs/wasm-runtime": "catalog:"
}
}
21 changes: 11 additions & 10 deletions packages/rolldown/src/binding.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { readFileSync } = require('node:fs')
const { readFileSync } = require('fs')
let nativeBinding = null
const loadErrors = []

Expand Down Expand Up @@ -33,7 +33,7 @@ const isMuslFromFilesystem = () => {

const isMuslFromReport = () => {
let report = null
if (typeof process.report?.getReport === 'function') {
if (process.report && typeof process.report.getReport === 'function') {
process.report.excludeNetwork = true
report = process.report.getReport()
}
Expand Down Expand Up @@ -105,7 +105,7 @@ function requireNative() {
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
try {
return require('./rolldown-binding.win32-x64-gnu.node')
} catch (e) {
Expand Down Expand Up @@ -570,17 +570,18 @@ if (!nativeBinding || forceWasi) {

if (!nativeBinding) {
if (loadErrors.length > 0) {
throw new Error(
const error = new Error(
`Cannot find native binding. ` +
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
{
cause: loadErrors.reduce((err, cur) => {
cur.cause = err
return cur
}),
},
)
// assign instead of the `new Error(message, { cause })` options form,
// which Node < 16.9 silently ignores
error.cause = loadErrors.reduce((err, cur) => {
cur.cause = err
return cur
})
throw error
}
throw new Error(`Failed to load native binding`)
}
Expand Down
Loading
Loading