Open enkelmedia opened 5 months ago
Hi there @enkelmedia!
Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.
We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.
Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:
Hmmm that's tricky one, I will bring this one up with the team to discuss 😁
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
v14
Bug summary
I'm working on a extension for Umbraco 14 and after moving my "proof of concept"-code for Bellissima in to a upgraded branch that used to run fine on v13 i noticed an error that I did not see during proof of concept work.
The browser console would throw:
Extension with alias Extension.EntryPoint is already registered
The problem seems to be because of how the
umbraco-package.json
is loaded usingWebHostingEnvironment.WebRootFileProvider
.Specifics
I made some more in depth research and it turn out that the problem was that I had an old folder in the consuming website with a different casing.
Here is a screenshot from the solution.
newsletterStudio
.NewsletterStudio
(notice the difference in case).I added a simple view to explore what the WebRootFileProvider finds in the application:
The result looked like this:
Since I'm on a Window-machine the files returned by these two calls are the same
WebRootFileProvider.GetDirectoryContents("App_Plugins/newsletterStudio")
WebRootFileProvider.GetDirectoryContents("App_Plugins/NewsletterStudio")
Basically, the same
umbraco-package.json
is loaded twice since there are two folders with the same name and on my Windows 11 machine the same file is returned for both these calls. I 've not tested this on Linux/Mac.Steps to reproduce
umbraco-package.json
with some configured extensions in App_Plugins\myPackage (camel case important)App_Plugins\MyPackage
(pascal case important) and put a readme.md file inside.Run the v14 backoffice and notice that the error is shown since the code that loads the umbraco-package files will load the plugin twice.
Expected result / actual result
The
umbraco-package.json
file should only be loaded once.One could say that this is an issue with my solution setup but I could see scenarios for other packages where a developer using the package might add a folder with a casing that does not match the one in the RCL which would cause the same issue.
I can see different solutions and I think it depends on how the scenario would work on a file system that is case sensitive. IF the filesystem is case sensitive (Linux/Mac) it would probably be theoretically possible to have two different extensions in folders where the casing is the only difference, definitely not a good idea but it would be possible.
Ideas for solution:
umbraco-package.json
from the excluded folder is not loaded if someone really wanted to use the same folder name in different case).Let me know if you need any further details!
// Markus