Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
90a41102
Commit
90a41102
authored
Dec 31, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve error message
parent
1b4c76c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
nft_json.rs
crates/next-api/src/nft_json.rs
+11
-6
No files found.
crates/next-api/src/nft_json.rs
View file @
90a41102
...
@@ -80,26 +80,30 @@ impl OutputAsset for NftJsonAsset {
...
@@ -80,26 +80,30 @@ impl OutputAsset for NftJsonAsset {
pub
struct
OutputSpecifier
(
Option
<
RcStr
>
);
pub
struct
OutputSpecifier
(
Option
<
RcStr
>
);
fn
get_output_specifier
(
fn
get_output_specifier
(
path_ref
:
&
FileSystemPath
,
chunk
:
ResolvedVc
<
Box
<
dyn
OutputAsset
>>
,
chunk_path
:
&
FileSystemPath
,
ident_folder
:
&
FileSystemPath
,
ident_folder
:
&
FileSystemPath
,
ident_folder_in_project_fs
:
&
FileSystemPath
,
ident_folder_in_project_fs
:
&
FileSystemPath
,
output_root
:
&
FileSystemPath
,
output_root
:
&
FileSystemPath
,
project_root
:
&
FileSystemPath
,
project_root
:
&
FileSystemPath
,
)
->
Result
<
RcStr
>
{
)
->
Result
<
RcStr
>
{
// include assets in the outputs such as referenced chunks
// include assets in the outputs such as referenced chunks
if
path_ref
.is_inside_ref
(
output_root
)
{
if
chunk_path
.is_inside_ref
(
output_root
)
{
return
Ok
(
ident_folder
.get_relative_path_to
(
path_ref
)
.unwrap
());
return
Ok
(
ident_folder
.get_relative_path_to
(
chunk_path
)
.unwrap
());
}
}
// include assets in the project root such as images and traced references (externals)
// include assets in the project root such as images and traced references (externals)
if
path_ref
.is_inside_ref
(
project_root
)
{
if
chunk_path
.is_inside_ref
(
project_root
)
{
return
Ok
(
ident_folder_in_project_fs
return
Ok
(
ident_folder_in_project_fs
.get_relative_path_to
(
path_ref
)
.get_relative_path_to
(
chunk_path
)
.unwrap
());
.unwrap
());
}
}
// This should effectively be unreachable
// This should effectively be unreachable
bail!
(
"NftJsonAsset: cannot handle filepath {path_ref}"
);
bail!
(
"NftJsonAsset: cannot handle filepath '{chunk_path}' for {chunk:?} it is not under the
\
output_root: '{output_root}' or the project_root: '{project_root}'"
,
);
}
}
/// Apply outputFileTracingIncludes patterns to find additional files
/// Apply outputFileTracingIncludes patterns to find additional files
...
@@ -286,6 +290,7 @@ impl Asset for NftJsonAsset {
...
@@ -286,6 +290,7 @@ impl Asset for NftJsonAsset {
}
}
let
specifier
=
get_output_specifier
(
let
specifier
=
get_output_specifier
(
referenced_chunk
,
&
referenced_chunk_path
,
&
referenced_chunk_path
,
&
ident_folder
,
&
ident_folder
,
&
ident_folder_in_project_fs
,
&
ident_folder_in_project_fs
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment