summaryrefslogtreecommitdiff
path: root/ext/node
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node')
-rw-r--r--ext/node/ops/require.rs2
-rw-r--r--ext/node/package_json.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs
index de2687001..3e1f1c6ae 100644
--- a/ext/node/ops/require.rs
+++ b/ext/node/ops/require.rs
@@ -451,7 +451,7 @@ where
let file_path = PathBuf::from(file_path);
ensure_read_permission::<P>(state, &file_path)?;
let fs = state.borrow::<FileSystemRc>();
- Ok(fs.read_text_file_sync(&file_path, None)?)
+ Ok(fs.read_text_file_lossy_sync(&file_path, None)?)
}
#[op2]
diff --git a/ext/node/package_json.rs b/ext/node/package_json.rs
index adae7d634..a19a2d64d 100644
--- a/ext/node/package_json.rs
+++ b/ext/node/package_json.rs
@@ -82,7 +82,7 @@ impl PackageJson {
return Ok(CACHE.with(|cache| cache.borrow()[&path].clone()));
}
- let source = match fs.read_text_file_sync(&path, None) {
+ let source = match fs.read_text_file_lossy_sync(&path, None) {
Ok(source) => source,
Err(err) if err.kind() == ErrorKind::NotFound => {
return Ok(Rc::new(PackageJson::empty(path)));