Answers.Body: <p>I wasn't aware that Flexmailer had moved from being a contributed extension to being a core extension, so consequently went ahead and installed the contrib extension as I normally would when getting Mosaico installed. So I ended up with two copies of the extension, which led to the error.
  To fix it I disabled Mosaico and Flexmailer extensions (need to disable Mosaico as it depends on Flexmailer), uninstalled the Flexmailer extension, deleted the extension files from my contributed extensions directory, then refreshed my extensions listing, installed and enabled Flexmailer (which is now listed as a core extension - i.e. the path to the code shows that it is a core extension), and then re-enabled Mosaico.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-03T10:09:24.010Z
Answers.Text: That's indeed how to fix it. See also https://civicrm.stackexchange.com/questions/39134/civicrm-core-now-includes-flexmailer-how-to-remove-old-flexmailer-extension
Answers.UserDisplayName: AlainB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-24T11:56:36.270Z
Answers.LastActivityDate: 2021-10-24T11:56:36.270Z
Answers.UserDisplayName: Graham
Body: <p>Here's the error I'm seeing:</p>
  <p>The website encountered an unexpected error. Please try again later.</p>
  <p>Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The &quot;civi_flexmailer_required_tokens&quot; service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead. in Symfony\Component\DependencyInjection\Container-&gt;make() (line 275 of /home/sites/dev/vendor/symfony/dependency-injection/Container.php).</p>
  <p>Any pointers most welcome.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-28T03:14:00.773Z
Comments.Text: Did you see any errors in Composer when you were downloading? Was this an upgrade or a new install?
Comments.UserDisplayName: Steve
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-29T08:50:01.053Z
Comments.Text: Not that I'm aware of. It's a relatively new site that I'm working on. I've not come across the error before, so I'm assuming that it has arisen following an update.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-19T08:47:03.653Z
Comments.Text: I am getting this as well. It's a brand new D9 site and I've placed a database into it from an old D7 site. I can't run Mosaico, or access the System Status page.
Comments.UserDisplayName: Rob Squires
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-19T20:25:22.293Z
Comments.Text: is this anything to do with flexmailer now being a core extension but you still having the contrib extension?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-20T08:58:03.843Z
Comments.Text: Could be. I've clearly missed the memo on that one as I wasn't aware of the change, but I'll check.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-22T17:34:07.570Z
Comments.Text: This problem, being based in Core, is agnostic as to CMS or use of Symfony. For ongoing helpfulness of this question, I'd suggest editing those details out of the question title and tags.
Comments.UserDisplayName: Phil Morice Brubaker
Tags: <flexmailer><symfony>
Title: Getting a strange error when visiting some pages on a D9 Civi 5.38 site related to Symfony container and flexmailer tokens
ThreadText: # Getting a strange error when visiting some pages on a D9 Civi 5.38 site related to Symfony container and flexmailer tokens
  
  (Asked by: username_0 on 2021-06-27)
  
  Here's the error I'm seeing:
  
  The website encountered an unexpected error. Please try again later.
  
  Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "civi\_flexmailer\_required\_tokens" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead. in Symfony\Component\DependencyInjection\Container->make() (line 275 of /home/sites/dev/vendor/symfony/dependency-injection/Container.php).
  
  Any pointers most welcome.
  
  **Tags:** flexmailer, symfony
  
  > **Comments:**
  > **username_1**: Did you see any errors in Composer when you were downloading? Was this an upgrade or a new install?  
  > **username_0**: Not that I'm aware of. It's a relatively new site that I'm working on. I've not come across the error before, so I'm assuming that it has arisen following an update.  
  > **username_2**: I am getting this as well. It's a brand new D9 site and I've placed a database into it from an old D7 site. I can't run Mosaico, or access the System Status page.  
  > **username_3**: is this anything to do with flexmailer now being a core extension but you still having the contrib extension?  
  > **username_0**: Could be. I've clearly missed the memo on that one as I wasn't aware of the change, but I'll check.  
  > **username_4**: This problem, being based in Core, is agnostic as to CMS or use of Symfony. For ongoing helpfulness of this question, I'd suggest editing those details out of the question title and tags.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-10-24. Score: 9 | Accepted answer
  
  I wasn't aware that Flexmailer had moved from being a contributed extension to being a core extension, so consequently went ahead and installed the contrib extension as I normally would when getting Mosaico installed. So I ended up with two copies of the extension, which led to the error.
  To fix it I disabled Mosaico and Flexmailer extensions (need to disable Mosaico as it depends on Flexmailer), uninstalled the Flexmailer extension, deleted the extension files from my contributed extensions directory, then refreshed my extensions listing, installed and enabled Flexmailer (which is now listed as a core extension - i.e. the path to the code shows that it is a core extension), and then re-enabled Mosaico.
  
  > **Comments:**
  > **username_5**: That's indeed how to fix it. See also https://civicrm.stackexchange.com/questions/39134/civicrm-core-now-includes-flexmailer-how-to-remove-old-flexmailer-extension  
  
  ---
  
  