Why do i keep getting this error when creating dat...
# help-with-umbraco
r
Copy code
umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:147 Error: [$controller:ctrlreg] http://errors.angularjs.org/1.8.3/$controller/ctrlreg?p0=SuggestionPluginController
    at umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:25:168
    at umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:117:19
    at ea (umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:99:20)
    at p (umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:90:355)
    at g (umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:84:186)
    at umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:83:311
    at Object.link (umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:321:432)
    at umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:35:134
    at Ca (umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:108:361)
    at p (umbraco-backoffice-js.js.v69c59d6964fd127d23f9a518f93a556d182cea2f:92:340) '<div ng-include="propertyEditorView">'
@huwred
h
Not seen that before, what version of umbraco are you using?
r
12.3.1
h
Are you getting the error in production or in dev?
Is it a vanilla Umbraco, or do you have any packages installed?
r
Dev Vanilla
a
Seems there is a
SuggestionPluginController
somewhere causing issues
r
@Anders Bjerner yes thats the datatype im trying to make
suggestion.controller.js: https://pastecord.com/zyjyzaxece suggestion.html: https://pastecord.com/ujodikuqak
Copy code
{
  "propertyEditors": [
    {
      "alias": "Suggestions editor",
      "name": "Suggestions",
      "icon": "icon-list",
      "group": "Common",
      "editor": {
        "view": "~/App_Plugins/Suggestions/suggestion.html",
        "supportsReadOnly": true
      }
    }
  ],
  "javascript": [
    "~/App_Plugins/Suggestions/suggestion.controller.js"
  ]
}
a
controller looks good from what I can tell
r
@Anders Bjerner any ideas for debuggin?
a
Try adding
"bundleOptions": "None",
to your
package.manifest
file. By default, Umbraco will bundle all or most JS files together - both Umbraco's own and JS files from packages.
None
essentially tells Umbraco to return your files "as is". Ideally you shouldn't use this in production, but you can use it for testing. If there is something wrong with your controller, you might be able to see something now in the browser console.
Usually when seeing this error it's because someone has missed a
;
somewhere in the code. This matters a lot when files are bundled and minified.
r
still the same
@Anders Bjerner i am abit suspicious of this tho in my project file
Copy code
<!-- Exclude environment specific web configs -->
    <ItemGroup>
        <None Include="App_Plugins\Suggestions\package.manifest" />
        <None Include="App_Plugins\Suggestions\suggestion.controller.js" />
        <None Include="web.Development.config">
            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
        </None>
        <None Include="web.Production.config">
            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
        </None>
    </ItemGroup>
    <ItemGroup>
        <Content Remove="web.Development.config" />
        <Content Remove="web.Production.config" />
    </ItemGroup>
</Project>
a
I think
None
is fine since it still has the
Include
.
r
this is actually driving me nuts lul
a
What does
/App_Plugins/Suggestions/suggestion.controller.js
look like if you access it directly on the dev server? Either physically on the server or via the browser
r
Copy code
Could not load content for https://alaborg.localhost/App_Plugins/YourCustomPropertyEditor/myPropertyEditorController.js (HTTP error: status code undefined, net::ERR_HTTP2_PROTOCOL_ERROR)
a
So your manifest seems to be wrong
r
Copy code
{
  "propertyEditors": [
    {
      "alias": "Suggestions editor",
      "name": "Suggestions",
      "icon": "icon-list",
      "group": "Common",
      "bundleOptions": "None",
      "editor": {
        "view": "~/App_Plugins/Suggestions/suggestion.html",
        "supportsReadOnly": true
      }
    }
  ],
  "javascript": [
    "~/App_Plugins/Suggestions/suggestion.controller.js"
  ]
}
a
Does it also look like this in the dev environment?
a
try deleting that folder.
r
yea wait thats not even the controler im working on i just noticed, its a old one
a
then try adding something like this to your csproj file:
Copy code
xml
  <ItemGroup>
    <Content Include="App_Plugins\Suggestions\**\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
and then possibly also delete these two lines:
Copy code
xml
        <None Include="App_Plugins\Suggestions\package.manifest" />
        <None Include="App_Plugins\Suggestions\suggestion.controller.js" />
So it might have to be
Content
and not
None
- although
None
could possibly work if it had the
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
🤔
The one with the wildcards/asterisks is what I'm using on client projects
r
im so confused tho why is it trying to fetch "myPropertyEditorController.js" thats not mentioned any where
r
no manifest
and the naming is not correct
a
Is this locally or in the dev environment?
r
its all local
a
Ok. So what happened to your
Suggestions
folder?
r
its not there it never was
for some reason its trying to fetch /yourcustomproperty i have no idea why
a
So where is your
package.manifest
file now?
a
So both screenshot are local? I'm not following
r
yes there is only local
its all running on my machine
a
so why do they show different files?
r
thats what im asking lol
'myPropertyEditorController.js
is not mentioned anywhere
a
Is one screenshot the actual project files, and is the other a result of a
dotnet publish
or something? Otherwise the two screenshots should show exactly the same files
maybe i miss understood what u asked for
a
Ah - helps with a bit more context. I didn't know one of the screenshots were from Chrome.
How do you run the site? And when have you last restarted it? Adding or making changes to
package.manifest
files will not have any effect unless the site is restarted.
r
running it localy trough the iis and cleaning and rebuilding every time i made a change
h
It looks like iis is pointing at a different set of code
21 Views