plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
254 stars 191 forks source link

Failing to compile bundles TTW #2745

Closed ale-rt closed 5 years ago

ale-rt commented 5 years ago

What I did:

I tried to compile the js bundle TTW

What I expect to happen:

I have a new bundle

What actually happened:

A js error occured

What version of Plone/ Addons I am using:

buildout.coredev 5.2

ale-rt commented 5 years ago

Maybe related #2542, but it was probably failing also before.

The error I get is:

resourceregistry-compiled.min.js:17 GET http://localhost:8080/Plone/++plone++static/components/r.js/dist/r.js net::ERR_ABORTED 404 (Not Found)
ale-rt commented 5 years ago

After this patch (which I think is needed anyway):

diff --git a/Products/CMFPlone/controlpanel/browser/resourceregistry.py b/Products/CMFPlone/controlpanel/browser/resourceregistry.py
index 9d502889c..7e773d9ec 100644
--- a/Products/CMFPlone/controlpanel/browser/resourceregistry.py
+++ b/Products/CMFPlone/controlpanel/browser/resourceregistry.py
@@ -414,9 +414,9 @@ class ResourceRegistryControlPanelView(RequireJsView):
         except KeyError:
             less_url = '++plone++static/components/less/dist/less-1.7.4.min.js'
         try:
-            rjs_url = resources['rjs'].js
+            rjs_url = resources['requirejs'].js
         except KeyError:
-            rjs_url = '++plone++static/components/r.js/dist/r.js'
+            rjs_url = '++plone++static/components/requirejs/require.js'

         data = {
             'development': self.registry['plone.resources.development'],

I have this error:

Uncaught TypeError: a.window.requirejs.optimize is not a function
    at Object.onLoad (resourceregistry-compiled.min.js:18)
    at window.IFrame.load (resourceregistry-compiled.min.js:17)
    at onload (@@resourceregistry-controlpanel:1)
    at window.IFrame.init (resourceregistry-compiled.min.js:17)
    at new window.IFrame (resourceregistry-compiled.min.js:17)
    at g.i._buildJSBundle (resourceregistry-compiled.min.js:18)
    at Object.success (resourceregistry-compiled.min.js:18)
    at j (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at x (jquery.min.js:5)
onLoad @ resourceregistry-compiled.min.js:18
load @ resourceregistry-compiled.min.js:17
onload @ @@resourceregistry-controlpanel:1
init @ resourceregistry-compiled.min.js:17
window.IFrame @ resourceregistry-compiled.min.js:17
i._buildJSBundle @ resourceregistry-compiled.min.js:18
success @ resourceregistry-compiled.min.js:18
j @ jquery.min.js:2
fireWith @ jquery.min.js:2
x @ jquery.min.js:5
b @ jquery.min.js:5
load (async)
init @ resourceregistry-compiled.min.js:17
window.IFrame @ resourceregistry-compiled.min.js:17
i._buildJSBundle @ resourceregistry-compiled.min.js:18
success @ resourceregistry-compiled.min.js:18
j @ jquery.min.js:2
fireWith @ jquery.min.js:2
x @ jquery.min.js:5
b @ jquery.min.js:5
XMLHttpRequest.send (async)
(anonymous) @ VM7916:1
send @ jquery.min.js:5
ajax @ jquery.min.js:5
i.buildJS @ resourceregistry-compiled.min.js:18
(anonymous) @ resourceregistry-compiled.min.js:18
dispatch @ jquery.min.js:4
b.dispatch @ resourceregistry-compiled.min.js:3
r.handle @ jquery.min.js:4
thet commented 5 years ago

Fixed by: https://github.com/plone/plone.staticresources/pull/45/commits/2a964ce2f6e977168a2a95837e265a89e0770449