Error when trying to do "npm start" on brave-browser project

Hi Brave Community,

I’m quite new to open source and have decided to get involved in Brave since you guys have some awesome projects here.

I was trying to build and run Brave locally on my Windows environment and have succeeded in doing that. However, when I tried to checkout to a new branch and rebuild (I haven’t made any changes locally yet), somehow the “npm start” stopped working following with this below error

[10992:3392:0525/001832.359:FATAL:navigation_entry_impl.cc(84)] Check failed: !entry || entry->initiator_origin() == state.initiator_origin.
Backtrace:
        base::debug::CollectStackTrace [0x00007FFC8CE70862+18] (C:\brave-browser\src\base\debug\stack_trace_win.cc:305)
        base::debug::StackTrace::StackTrace [0x00007FFC8CD38622+18] (C:\brave-browser\src\base\debug\stack_trace.cc:218)
        logging::LogMessage::~LogMessage [0x00007FFC8CD58C2D+141] (C:\brave-browser\src\base\logging.cc:601)
        logging::LogMessage::~LogMessage [0x00007FFC8CD59FA0+16] (C:\brave-browser\src\base\logging.cc:594)
        content::`anonymous namespace'::RecursivelyGenerateFrameEntries [0x00007FFC801D3202+829] (C:\brave-browser\src\content\browser\renderer_host\navigation_entry_impl.cc:85)
        content::`anonymous namespace'::RecursivelyGenerateFrameEntries [0x00007FFC801D3726+2145] (C:\brave-browser\src\content\browser\renderer_host\navigation_entry_impl.cc:114)
        content::`anonymous namespace'::RecursivelyGenerateFrameEntries [0x00007FFC801D3726+2145] (C:\brave-browser\src\content\browser\renderer_host\navigation_entry_impl.cc:114)
        content::`anonymous namespace'::RecursivelyGenerateFrameEntries [0x00007FFC801D3726+2145] (C:\brave-browser\src\content\browser\renderer_host\navigation_entry_impl.cc:114)
        content::NavigationEntryImpl::SetPageState [0x00007FFC801D2E7F+287] (C:\brave-browser\src\content\browser\renderer_host\navigation_entry_impl.cc:527)
        sessions::ContentSerializedNavigationBuilder::ToNavigationEntry [0x00007FFC7C831FF9+585] (C:\brave-browser\src\components\sessions\content\content_serialized_navigation_builder.cc:148)
        sessions::ContentSerializedNavigationBuilder::ToNavigationEntries [0x00007FFC7C83265E+142] (C:\brave-browser\src\components\sessions\content\content_serialized_navigation_builder.cc:205)
        chrome::`anonymous namespace'::CreateRestoredTab [0x00007FFC78F8EAF1+566] (C:\brave-browser\src\chrome\browser\ui\browser_tabrestore.cc:91)
        chrome::AddRestoredTab_ChromiumImpl [0x00007FFC78F8E7F7+211] (C:\brave-browser\src\chrome\browser\ui\browser_tabrestore.cc:243)
        chrome::AddRestoredTab [0x00007FFC78F8F5DB+387] (C:\brave-browser\src\brave\chromium_src\chrome\browser\ui\browser_tabrestore.cc:60)
        SessionRestoreImpl::RestoreTab [0x00007FFC783879CC+608] (C:\brave-browser\src\chrome\browser\sessions\session_restore.cc:809)
        SessionRestoreImpl::RestoreTabsToBrowser [0x00007FFC78386259+521] (C:\brave-browser\src\chrome\browser\sessions\session_restore.cc:742)
        SessionRestoreImpl::ProcessSessionWindows [0x00007FFC783856BD+709] (C:\brave-browser\src\chrome\browser\sessions\session_restore.cc:606)
        SessionRestoreImpl::ProcessSessionWindowsAndNotify [0x00007FFC783844A1+79] (C:\brave-browser\src\chrome\browser\sessions\session_restore.cc:492)
        SessionRestoreImpl::Restore [0x00007FFC78382B33+801] (C:\brave-browser\src\chrome\browser\sessions\session_restore.cc:207)
        SessionRestore::RestoreSession [0x00007FFC78382595+445] (C:\brave-browser\src\chrome\browser\sessions\session_restore.cc:1070)
        StartupBrowserCreatorImpl::RestoreOrCreateBrowser [0x00007FFC78B77984+100] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator_impl.cc:623)
        StartupBrowserCreatorImpl::DetermineURLsAndLaunch [0x00007FFC78B76A2D+857] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator_impl.cc:438)
        StartupBrowserCreatorImpl::Launch [0x00007FFC78B765D2+110] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator_impl.cc:173)
        BraveStartupBrowserCreatorImpl::Launch [0x00007FFC77DBA425+221] (C:\brave-browser\src\brave\chromium_src\chrome\browser\ui\startup\startup_browser_creator.cc:71)
        StartupBrowserCreator::LaunchBrowser [0x00007FFC77DBBA7C+470] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator.cc:678)
        StartupBrowserCreator::LaunchBrowserForLastProfiles [0x00007FFC77DBBFC2+422] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator.cc:738)
        StartupBrowserCreator::ProcessCmdLineImpl [0x00007FFC77DBB84A+4332] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator.cc:1228)
        StartupBrowserCreator::Start [0x00007FFC77DBA64C+164] (C:\brave-browser\src\chrome\browser\ui\startup\startup_browser_creator.cc:630)
        ChromeBrowserMainParts::PreMainMessageLoopRunImpl [0x00007FFC77C8A445+3085] (C:\brave-browser\src\chrome\browser\chrome_browser_main.cc:1751)
        ChromeBrowserMainParts::PreMainMessageLoopRun [0x00007FFC77C89781+65] (C:\brave-browser\src\chrome\browser\chrome_browser_main.cc:1142)
        content::BrowserMainLoop::PreMainMessageLoopRun [0x00007FFC7FCD3ABB+107] (C:\brave-browser\src\content\browser\browser_main_loop.cc:983)
        base::OnceCallback<int ()>::Run [0x00007FFC803E9488+60] (C:\brave-browser\src\base\callback.h:143)
        content::StartupTaskRunner::RunAllTasksNow [0x00007FFC803E940C+28] (C:\brave-browser\src\content\browser\startup_task_runner.cc:43)
        content::BrowserMainLoop::CreateStartupTasks [0x00007FFC7FCD368C+588] (C:\brave-browser\src\content\browser\browser_main_loop.cc:896)
        content::BrowserMainRunnerImpl::Initialize [0x00007FFC7FCD6A68+136] (C:\brave-browser\src\content\browser\browser_main_runner_impl.cc:136)
        content::BrowserMain [0x00007FFC7FCD198B+199] (C:\brave-browser\src\content\browser\browser_main.cc:26)
        content::RunBrowserProcessMain [0x00007FFC80AA6AD3+331] (C:\brave-browser\src\content\app\content_main_runner_impl.cc:640)
        content::ContentMainRunnerImpl::RunBrowser [0x00007FFC80AA80AE+1308] (C:\brave-browser\src\content\app\content_main_runner_impl.cc:1147)
        content::ContentMainRunnerImpl::Run [0x00007FFC80AA7B5F+639] (C:\brave-browser\src\content\app\content_main_runner_impl.cc:1023)
        content::RunContentProcess [0x00007FFC80AA648C+1692] (C:\brave-browser\src\content\app\content_main.cc:407)
        content::ContentMain [0x00007FFC80AA65A4+84] (C:\brave-browser\src\content\app\content_main.cc:435)
        ChromeMain [0x00007FFC75591281+481] (C:\brave-browser\src\chrome\app\chrome_main.cc:179)
        MainDllLoader::Launch [0x00007FF7C9D627A6+358] (C:\brave-browser\src\chrome\app\main_dll_loader_win.cc:167)
        wWinMain [0x00007FF7C9D61BD3+2996] (C:\brave-browser\src\chrome\app\chrome_exe_main_win.cc:382)
        __scrt_common_main_seh [0x00007FF7C9E0F1D6+262] (C:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
        BaseThreadInitThunk [0x00007FFCF8697034+20]
        RtlUserThreadStart [0x00007FFCF8E22651+33]
Crash keys:
  "ui_scheduler_async_stack" = "0x7FFC7C83BBB4 0x7FFC7C83BBB4"
  "num-extensions" = "0"
  "is-enterprise-managed" = "no"
  "io_scheduler_async_stack" = "0x7FFCB2B1933B 0x0"
  "switch-9" = "--variations-insecure-server-url"
  "switch-8" = "--variations-server-url"
  "switch-7" = "--lso-url=https://no-thanks.invalid"
  "switch-6" = "--sync-url"
  "switch-5" = "--origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld"
  "switch-4" = "--enable-dom-distiller"
  "switch-3" = "--disable-domain-reliability"
  "switch-2" = "--disable-client-side-phishing-detection"
  "switch-1" = "--disable-brave-update"
  "num-switches" = "13"

null
null


I was looking/googling for the last two days but still couldn’t figure out what it means (I went into the file displayed in the error to read the code but I’m too inexperience in all of this to understand it to be honest), keep in mind that the build seems to be error-free, this error only appear when I run “npm start”

Did I accidentally mess up something? How should I fix this?

@alexng

I am not an expert, re the adventure you are set upon, but I happened to notice:

Screen Shot 2022-06-21 at 7.06.42 PM

When, in a Brave Browser > New Window, you go to: brave://version and scroll down to Command Line:, you will find, in all that jargon, the following switch, with a much longer public key string:

  • --origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU=

That value seems to be a constant, as a public key for Brave Browser desktop users.

Various of your Crash keys: switches, also seem to be found among the switches of Command Line: