Stream multiple Directory Managers in React Pages

Hi, we need to set up multiple directory managers for the same account (one DM for locations, and one DM for people).
The DMs have been set up correctly in the KG, and we now have 2 separate sets of filters, with 2 separate roots/states/cities/children.
Since each directory will have its own subdomain, we’ve created 2 projects (in React).
In each project we set up the DM stream using the correct filter ID, however when we run it (either project) we get the following error message in the console, and the index page (as well as state and city pages) return a 404:
ERROR: Expected one external entity id to be found. Found the following list of entities id instead: [location-directory people-directory]
Are we going about it the wrong way, or is there a limitation on how many DM can run on the same account?

Hi Andrea,

Do you have 2 different root entities? Do they each have the same slug? I have had an issue with having 2 Directory Managers in the same account before and I am trying to determine if this is the same issue that I am familiar with.

Thanks,

Aaron

Hi Aaron, thanks for your fast reply. Yes, we do have 2 different root entities, and both with the slug index.html - is that what’s causing the issue?

Hi @Andrea_Gentile ,

This is unfortunately a known issue - and occurs when multiple entities in your CMS share the same slug.

To avoid this, you can either 1) temporarily update the slug of the root entity you are not using for local development; or 2) run this command instead - npm run dev:no-prod-url - refer to this reference article for more information.

I have raised this as a GitHub issue, which we are looking to incorporate into our backlog hopefully within the next month.

Best,
Luc

Great, thank you Luc! Does that mean the issue is only during local development, but when deployed (to staging and/or production) they will both work with the current set up?

Hi @Andrea_Gentile ,

That is correct. This issue will not affect production deployment.

1 Like

Hi @Luc_Yuki_Marrie I can confirm that changing the slug for the second root entity works, however it’s the same issue with state and city entities as well. So, instead of changing the slugs we tried option 2, but when we enter npm run dev:no-prod-url we get the error message Missing script: "dev:no-prod-url" in the terminal. Am I missing some configuration or, do you know how to fix that? Thank you for your help on this!

@Andrea_Gentile ,

In your package.json:

  1. what is the @yext/pages version
  2. what is specified for your dev script command

@yext/pages is still at 1.0.0-beta.16 so I can update that - is it 1.0.0-beta.22 ?
the dev script command is "npm run build:local && yext pages generate-test-data && pages dev"

@Andrea_Gentile ,

Actually, the command is: npm run dev -- --no-prod-url.
Can you give that a try?

Best,
Luc

Thanks @Luc_Yuki_Marrie this did the trick! (can you edit the 2 dashes between dev and --no-prod-url to both be regular dashes, it looks like the second one has been changed to an mdash for some reason).
FYI, the links now don’t work when drilling down from the directory pages, but they do all work from the main index page you see when you first run the script. I think that’s to be expected though because the links rendered by the page templates don’t match with the generated links.