You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the route for admin panel is changed to let's say 'account,' the importMap is generated only in the default src/(payload)/admin. It does not respect the route set in root payload config.
Since changing admin route means renaming 'admin' folder (Next JS's app router thing) to 'account,' admin folder doesn't exist anymore and I get:
importMapFolderPath=path.resolve(rootDir,'src/app/(payload)/admin/');95|}else{>96|thrownewError(`Could not find the payload admin directory. Looked in ${path.resolve(rootDir,'app/(payload)/admin/')} and ${path.resolve(rootDir,'src/app/(payload)/admin/')}`);|^97|}
Expected
Payload automatically picks up which folder to overwrite importMap in based on payload config.
Workaround
Duplicate the 'account' folder in app router directories to 'admin,' then whenever a new importMap is generated, manually copy its content over to the importMap in my custom route's folder.
Reproduction Steps
Create-payload-app@beta
Create a custom component somewhere in the project. Mine's in: ./app/customActions/home
Ahh, definitely true, thank you for noticing this. Happy to close this one. Sorry for not doing my due diligence before posting. I looked for issues when it first started happening around 79, but then revisited proj 2 weeks later and assumed things were same when there was no fix.
Link to reproduction
Steps mentioned below
Environment Info
Describe the Bug
Current
Expected
Payload automatically picks up which folder to overwrite importMap in based on payload config.
Workaround
Duplicate the 'account' folder in app router directories to 'admin,' then whenever a new importMap is generated, manually copy its content over to the importMap in my custom route's folder.
Reproduction Steps
./app/customActions/home
admin
folder in ./app/(payload)/admin toaccount
to make admin panel work.Adapters and Plugins
sqlite, mongo
The text was updated successfully, but these errors were encountered: