'Argument is not a function, got undefined' JS error in custom section
Hi,
Update - The package.manfiest file isn't loading. I suppose that now poses a different question. Why isn't it loading? The path is correct and there's only one package.manfiest file in the folder. I've cleared Client Dependency cache and browser cache, touched web.config too, even restarted IIS express.
I'm getting the following javascript error in 7.2.6 when building a custom section in the back office of Umbraco. (When clicking on a root tree node to load up the edit view).
Argument 'MyApp.MyEditController' is not a function, got undefined
As you can see MyApp.MyEditController is just a simple test. My edit.html is as follows:
And finally the edit.controller.js is also very basic:
angular.module("umbraco").controller("MyApp.MyAppEditController",
function ($scope, $routeParams, notificationsService, navigationService) {
console.log($routeParams);
});
Whether it's a simple test like this or not the issue persists.
Does anyone have any idea why this is happening?
Note the section itself works fine otherwise, it is only on the edit view of a tree node.
The package.manfiest file isn't loading. I suppose that now poses a different question. Why isn't it loading? The path is correct and there's only one package.manfiest file in the folder.
Ok this has been solved. A rather odd solution so incase anyone else gets this problem in future.
The issue was because of bom characters. I tried to recreate the package.manifest file in Visual Studio with no joy but then created it again without BOM encoding and it now works fine!
To save a file without BOM in Visual Studio you can:
File > Advanced Save Options > Choose 'UTF-8 without signature'.
I have come accross the same error yet nothing seems to fix it. I have recycled my pool in IIS, I've cleared the browser cached, I've resaved the manifest following the instructions above, I've recreated the whole file twice yet every time still getting the same error
Had the same error with Umbraco 7.4.3. Tried clearing the browsers cache, recycle the app pool etc. Didn't work.
Solved it by moving my controller file away from the "package.manifest"-file to a separate directory and after that I altered the path to the file in package.manifest
Wow man, thank you for posting that because that also solved it for me. So the manifest can't be in the same directory as the files it references? That is so weird to me.
Thanks again for posting your solution, ugh, I can't believe it was something so simple as that!
'Argument is not a function, got undefined' JS error in custom section
Hi,
Update - The package.manfiest file isn't loading. I suppose that now poses a different question. Why isn't it loading? The path is correct and there's only one package.manfiest file in the folder. I've cleared Client Dependency cache and browser cache, touched web.config too, even restarted IIS express.
I'm getting the following javascript error in 7.2.6 when building a custom section in the back office of Umbraco. (When clicking on a root tree node to load up the edit view).
As you can see MyApp.MyEditController is just a simple test. My edit.html is as follows:
My package.manfiest file (located at /App_Plugins/MyApp/package.manifest) contains:
And finally the edit.controller.js is also very basic:
Whether it's a simple test like this or not the issue persists.
Does anyone have any idea why this is happening?
Note the section itself works fine otherwise, it is only on the edit view of a tree node.
The package.manfiest file isn't loading. I suppose that now poses a different question. Why isn't it loading? The path is correct and there's only one package.manfiest file in the folder.
Thanks,
Dave
Comment author was deleted
For posterity purposes.
Looks like we solved it by recreating the manifest due an errant character (invisible).
Ok this has been solved. A rather odd solution so incase anyone else gets this problem in future.
The issue was because of bom characters. I tried to recreate the package.manifest file in Visual Studio with no joy but then created it again without BOM encoding and it now works fine!
To save a file without BOM in Visual Studio you can:
File > Advanced Save Options > Choose 'UTF-8 without signature'.
Thanks to Kevin for the tip to check BOM! :)
Thanks
Dave
I have come accross the same error yet nothing seems to fix it. I have recycled my pool in IIS, I've cleared the browser cached, I've resaved the manifest following the instructions above, I've recreated the whole file twice yet every time still getting the same error
Had the same error with Umbraco 7.4.3. Tried clearing the browsers cache, recycle the app pool etc. Didn't work.
Solved it by moving my controller file away from the "package.manifest"-file to a separate directory and after that I altered the path to the file in package.manifest
Wow man, thank you for posting that because that also solved it for me. So the manifest can't be in the same directory as the files it references? That is so weird to me.
Thanks again for posting your solution, ugh, I can't believe it was something so simple as that!
Cool! Glad it worked out for you (sorry for reposting, I deleted my previous reply by mistake)
is working on a reply...