I'm trying to duplicate a component but I get this error

I’m trying to understand how components work so I duplicated one and tried to follow how it’s made.
My component should be the brave_new_tab2, and should do the same thing as the new tab, the only difference should be the access of it, I should access is with brave://new_tab2 but I keep getting this error:

ERROR Input to target not generated by a dependency.
The file:
//out/Release/gen/brave/components/brave_new_tab2/resources/brave_new_tab_generated2.pak
is listed as an input or source for the target:
//brave/components/resources:resources
but no targets in the build generate that file.

ERROR Input to target not generated by a dependency.

The file:
//out/Release/gen/brave/components/brave_new_tab2/resources/brave_new_tab_generated2.pak.info
is listed as an input or source for the target:
//brave/components/resources:resources
but no targets in the build generate that file.

*If you have generated inputs, there needs to be a dependency path between the two targets in addition to just listing the files. For indirect dependencies, the intermediate ones must be public_deps. data_deps don’t count since they’re only runtime dependencies. If you think a dependency chain exists, it might be because the chain is private. *
Try “gn path” to analyze

Can someone help me with it, please?

Thank you very much!

Most likely, you’re missing a reference in a BUILD.gn file. If you copied from “brave_new_tab” search the entire src/brave structure for “brave_new_tab” and you’ll find all the places where you probably need a matching “brave_new_tab2”. The error says that BUILD.gn in components/resources/BUILD.gn references “brave_new_tab2” but it’s never actually built… My guess is that components/brave_new_tab2/BUILD.gn or components/BUILD.gn are the culprits here.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.