pydio / pydio-core

Pydio 8 official repository
https://pydio.com
GNU Affero General Public License v3.0
869 stars 289 forks source link

Building gui.ajax #1444

Open badfiles opened 5 years ago

badfiles commented 5 years ago

It is impossible to build with

npm install
grunt

because it has unresolved dependencies

npm WARN react-addons-css-transition-group@15.6.2 requires a peer of react@^15.4.2 but none was installed.
npm WARN qrcode.react@0.6.1 requires a peer of react@0.12 - 0.14 || ^15.0.0 but none was installed.
npm WARN react-tap-event-plugin@2.0.1 requires a peer of react@^15.4.0-0 but none was installed.
npm WARN react-tap-event-plugin@2.0.1 requires a peer of react-dom@^15.4.0-0 but none was installed.
npm WARN react-autosuggest@8.0.0 requires a peer of react@^0.14.7 || ^15.0.1 but none was installed.
npm WARN react-textfit@0.1.9 requires a peer of react@^0.14.0 but none was installed.
npm WARN react-textfit@0.1.9 requires a peer of react-dom@^0.14.0 but none was installed.
npm WARN react-grid-layout@0.13.9 requires a peer of react@^0.14.3 || ^15.0.0 but none was installed.
npm WARN react-grid-layout@0.13.9 requires a peer of react-dom@^0.14.3 || ^15.0.0 but none was installed.
npm WARN react-router@2.8.1 requires a peer of react@^0.14.0 || ^15.0.0 but none was installed.
npm WARN material-ui@0.17.4 requires a peer of react@^15.4.0 but none was installed.
npm WARN material-ui@0.17.4 requires a peer of react-dom@^15.4.0 but none was installed.
npm WARN react-addons-transition-group@15.6.2 requires a peer of react@^15.4.2 but none was installed.
npm WARN react-event-listener@0.4.5 requires a peer of react@^0.14.0 || ^15.0.0 but none was installed.
npm WARN recompose@0.23.5 requires a peer of react@^0.14.0 || ^15.0.0 but none was installed.
npm WARN react-autowhatever@7.0.0 requires a peer of react@^0.14.7 || ^15.0.1 but none was installed.

grunt runs successfully, but on execution I get

VM9178:7 Failed Loading React, PydioReactUI :  TypeError: _react.default.createContext is not a function
    at Object.require.911.@babel/runtime/helpers/interopRequireDefault (bundle.prod.min.js:formatted:60624)
    at s (bundle.prod.min.js:formatted:17)
    at eval (bundle.prod.min.js:formatted:19)
    at Object.require.912../Context (bundle.prod.min.js:formatted:60642)
    at s (bundle.prod.min.js:formatted:17)
    at eval (bundle.prod.min.js:formatted:19)
    at Object.require.react-redux../components/Context (bundle.prod.min.js:formatted:68257)
    at s (bundle.prod.min.js:formatted:17)
    at s (PydioHOCs.min.js:1)
    at eval (PydioHOCs.min.js:1)
(anonymous) @ VM9178:7
Promise.catch (async)
ResourcesManager.loadClassesAndApply @ VM9178:7
(anonymous) @ VM9178:11
Pydio.init @ VM9178:11
(anonymous) @ pydio.boot.min.js?v=8.2.2:4
scriptLoaded @ pydio.boot.min.js?v=8.2.2:4
(anonymous) @ pydio.boot.min.js?v=8.2.2:4
Promise.then (async)
Connexion.loadLibrary @ pydio.boot.min.js?v=8.2.2:4
PydioBootstrap.refreshContextVariablesAndInit @ pydio.boot.min.js?v=8.2.2:4
PydioBootstrap.loadBootConfig @ pydio.boot.min.js?v=8.2.2:4
(anonymous) @ pydio.boot.min.js?v=8.2.2:4
trigger @ pydio.boot.min.js?v=8.2.2:3
onReady @ pydio.boot.min.js?v=8.2.2:3
cdujeu commented 5 years ago

what are your grunt / npm versions? Do you have already a more recent version of react installed?

badfiles commented 5 years ago

npm v3.10.10 The grunt command line interface (v1.3.2) npm install gives warnings

npm WARN react-redux@6.0.0 requires a peer of react@^16.4.0-0 but none was installed.
npm WARN react-infinite@0.13.0 requires a peer of react@^16.2.0 but none was installed.
npm WARN react-infinite@0.13.0 requires a peer of react-dom@^16.2.0 but none was installed.
npm WARN react-textfit@0.1.9 requires a peer of react@^0.14.0 but none was installed.
npm WARN react-textfit@0.1.9 requires a peer of react-dom@^0.14.0 but none was installed.
npm WARN react-dom@15.6.2 requires a peer of react@^15.6.2 but none was installed.
npm WARN enzyme-adapter-react-16@1.1.1 requires a peer of enzyme@^3.0.0 but none was installed.
npm WARN enzyme-adapter-react-16@1.1.1 requires a peer of react@^16.0.0-0 but none was installed.
npm WARN enzyme-adapter-react-16@1.1.1 requires a peer of react-dom@^16.0.0-0 but none was installed.
npm WARN react-reconciler@0.7.0 requires a peer of react@^16.0.0 but none was installed.
npm WARN react-test-renderer@16.7.0 requires a peer of react@^16.0.0 but none was installed.
npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none was installed.

grunt says Done, without errors. after cleaning pydio cache I have

VM16687:7 Failed Loading React, PydioReactUI :  TypeError: _react.default.createContext is not a function
    at Object.require.910.@babel/runtime/helpers/interopRequireDefault (bundle.prod.min.js:54)
    at s (bundle.prod.min.js:1)
    at eval (bundle.prod.min.js:1)
    at Object.require.911../Context (bundle.prod.min.js:54)
    at s (bundle.prod.min.js:1)
    at eval (bundle.prod.min.js:1)
    at Object.require.react-redux../components/Context (bundle.prod.min.js:62)
    at s (bundle.prod.min.js:1)
    at s (PydioHOCs.min.js:1)
    at eval (PydioHOCs.min.js:1)

on the js console.

Blindmikey commented 5 years ago

I've run into this same issue.

sunny0070 commented 5 years ago

I'm also having same issue. Is there any solution for this issue?

cdujeu commented 5 years ago

mmmm, on our build machine, we have node --version 6.10.2 npm version 3.10.10 Can you check ?

sunny0070 commented 5 years ago

I've different version of node and npm. So, I switched to version you mentioned and tried to run below command: npm install ( gui.ajax ) grunt

Cli Result:- Done, without errors.

But when tried to access pydio. I found it's not working and in console error mention below

Failed Loading React, PydioReactUI : TypeError: _react.default.createContext is not a function at Object.require.910.@babel/runtime/helpers/interopRequireDefault (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:54) at s (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:1) at eval (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:1) at Object.require.911.../utils/Subscription (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:54) at s (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:1) at eval (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:1) at Object.require.react-redux../components/Context (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:62) at s (/pydio/plugins/gui.ajax/res/build/bundle.prod.min.js:1) at s (/pydio/plugins/gui.ajax/res/build/PydioHOCs.js:1) at eval (/pydio/plugins/gui.ajax/res/build/PydioHOCs.js:1)

sunny0070 commented 5 years ago

I'm using this grunt js file https://github.com/pydio/cells-front/blob/master/plugins/gui.ajax/Gruntfile.js

cdujeu commented 5 years ago

I'm lost here : if you are trying to build the front for pydio 8, why do you use the Gruntfile from cells-front (which is deprecated by the way, as the front for pydio cells is in the main Cells repo). Why not using pydio-core/..../gui.ajax/Gruntfile.js??

sunny0070 commented 5 years ago

Now, I'm using latest grunt file but this time again encounter same error with different trace

Failed Loading React, PydioReactUI : TypeError: _react.default.createContext is not a function at Object.require.910.@babel/runtime/helpers/interopRequireDefault (bundle.prod.min.js:54) at s (bundle.prod.min.js:1) at eval (bundle.prod.min.js:1) at Object.require.911.../utils/Subscription (bundle.prod.min.js:54) at s (bundle.prod.min.js:1) at eval (bundle.prod.min.js:1) at Object.require.react-redux../components/Context (bundle.prod.min.js:62) at s (bundle.prod.min.js:1) at s (_prelude.js:1) at eval (_prelude.js:1)

(anonymous) @ ResourcesManager.js:411
  Promise.catch (async)    
  loadClassesAndApply @ ResourcesManager.js:410
  (anonymous) @ Pydio:217
  init @ Pydio:231
  (anonymous) @ PydioBootstrap.js:198
  refreshContextVariablesAndInit @ PydioBootstrap.js:204
  loadBootConfig @ PydioBootstrap.js:102
  (anonymous) @ PydioBootstrap.js:82
  trigger @ doc-ready.js:51
  onReady @ doc-ready.js:43
sunny0070 commented 5 years ago

Do you confirm your react version you are using?

sunny0070 commented 5 years ago

In my case, react-redux library is creating issue because react-redux version higher or equal 6 is using different context API.

So, using react-redux version: 5.1.1 fix issue for me.

I hope this help someone.

cdujeu commented 5 years ago

ha ha ok so we should probably fix this in the json

sunny0070 commented 5 years ago

Yes, please so it's not trouble other people. Thanks