#[non_exhaustive]pub enum ResolveError {
Show 21 variants
Ignored(PathBuf),
NotFound(String),
MatchedAliasNotFound(String, String),
TsconfigNotFound(PathBuf),
TsconfigSelfReference(PathBuf),
TsconfigCircularExtend(CircularPathBufs),
IOError(IOError),
PathNotSupported(PathBuf),
Builtin {
resolved: String,
is_runtime_module: bool,
},
ExtensionAlias(String, String, PathBuf),
Specifier(SpecifierError),
Json(JSONError),
InvalidModuleSpecifier(String, PathBuf),
InvalidPackageTarget(String, String, PathBuf),
PackagePathNotExported {
subpath: String,
package_path: PathBuf,
package_json_path: PathBuf,
conditions: ConditionNames,
},
InvalidPackageConfig(PathBuf),
InvalidPackageConfigDefault(PathBuf),
InvalidPackageConfigDirectory(PathBuf),
PackageImportNotDefined(String, PathBuf),
Unimplemented(&'static str),
Recursion,
}Expand description
Module resolution and loading functionality. All resolution errors
thiserror is used to display meaningful error messages.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ignored(PathBuf)
Ignored path
Derived from ignored path (false value) from browser field in package.json
{
"browser": {
"./module": false
}
}See https://github.com/defunctzombie/package-browser-field-spec#ignore-a-module
NotFound(String)
Module not found
MatchedAliasNotFound(String, String)
Matched alias value not found
TsconfigNotFound(PathBuf)
Tsconfig not found
TsconfigSelfReference(PathBuf)
Tsconfig’s project reference path points to it self
TsconfigCircularExtend(CircularPathBufs)
Occurs when tsconfig extends configs circularly
IOError(IOError)
PathNotSupported(PathBuf)
Indicates the resulting path won’t be consumable by NodeJS import or require.
For example, DOS device path with Volume GUID (\\?\Volume{...}) is not supported.
Builtin
Node.js builtin module when Options::builtin_modules is enabled.
is_runtime_module can be used to determine whether the request
was prefixed with node: or not.
resolved is always prefixed with “node:” in compliance with the ESM specification.
ExtensionAlias(String, String, PathBuf)
All of the aliased extension are not found
Displays Cannot resolve 'index.mjs' with extension aliases 'index.mts' in ...
Specifier(SpecifierError)
The provided path specifier cannot be parsed
Json(JSONError)
JSON parse error
InvalidModuleSpecifier(String, PathBuf)
InvalidPackageTarget(String, String, PathBuf)
PackagePathNotExported
InvalidPackageConfig(PathBuf)
InvalidPackageConfigDefault(PathBuf)
InvalidPackageConfigDirectory(PathBuf)
PackageImportNotDefined(String, PathBuf)
Unimplemented(&'static str)
Recursion
Occurs when alias paths reference each other.
Implementations§
Source§impl ResolveError
impl ResolveError
pub const fn is_ignore(&self) -> bool
pub fn from_serde_json_error(path: PathBuf, error: &Error) -> ResolveError
Trait Implementations§
Source§impl Clone for ResolveError
impl Clone for ResolveError
Source§fn clone(&self) -> ResolveError
fn clone(&self) -> ResolveError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for ResolveError
impl From<Error> for ResolveError
Source§fn from(err: Error) -> ResolveError
fn from(err: Error) -> ResolveError
Source§impl PartialEq for ResolveError
impl PartialEq for ResolveError
impl StructuralPartialEq for ResolveError
Auto Trait Implementations§
impl Freeze for ResolveError
impl !RefUnwindSafe for ResolveError
impl Send for ResolveError
impl Sync for ResolveError
impl Unpin for ResolveError
impl UnsafeUnpin for ResolveError
impl !UnwindSafe for ResolveError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more