build_tools icon indicating copy to clipboard operation
build_tools copied to clipboard

Mobile web failed to build with default configuration

Open qianwch opened this issue 2 years ago • 9 comments

cd tools/linux ./automate.py server I would get the error reports:

>> /build/web-apps/vendor/framework7-react/node_modules/ora/index.js:1
>> import process from 'node:process';
>>        ^^^^^^^
>>
>> SyntaxError: Unexpected identifier
>>     at Module._compile (internal/modules/cjs/loader.js:723:23)
>>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
>>     at Module.load (internal/modules/cjs/loader.js:653:32)
>>     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
>>     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
>>     at Module.require (internal/modules/cjs/loader.js:692:17)
>>     at require (internal/modules/cjs/helpers.js:25:18)
>>     at Object.<anonymous> (/build/web-apps/vendor/framework7-react/build/build.js:2:13)
>>     at Module._compile (internal/modules/cjs/loader.js:778:30)
>>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

in the out directory, we do not get mobile web pages. ls build_tools/out/js/onlyoffice/builder/web-apps/apps/documenteditor/mobile/ will get: dist locale resources

qianwch avatar Oct 27 '22 14:10 qianwch

Hi.

  1. Try to build it not only server but whole package via ./automate.py without any params
  2. By building mobile client from source code it will not allow editing, since it's not a part of open-source package, it should be built, but will show license warning on opening

ShockwaveNN avatar Oct 28 '22 05:10 ShockwaveNN

Hi.

  1. Try to build it not only server but whole package via ./automate.py without any params
  2. By building mobile client from source code it will not allow editing, since it's not a part of open-source package, it should be built, but will show license warning on opening

I have tested again. With a new installed Ubuntu 16.04 system. And run ./automate.py without any params. Just no luck. I believe it is problem about the bundled framework7-react.

>> npm
>> WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@2. I'll try to do my best with it!
......
> [email protected] deploy-word /build/web-apps/vendor/framework7-react
> cross-env TARGET_EDITOR=word NODE_ENV=production node ./build/build.js

error in promise Error: Not supported
    at Object.<anonymous> (/build/web-apps/vendor/framework7-react/build/build.js:8:9)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

The built target contains no mobile pages. When open with mobile devices, the page will jump to 404 error.

qianwch avatar Oct 28 '22 10:10 qianwch

@qianwch Ok, thanks I'll recheck

ShockwaveNN avatar Oct 28 '22 11:10 ShockwaveNN

Our developers said that there is a possible workaround

Remove web-apps\vendor\framework7-react\node_modules folder and run npm install in web-apps\vendor\framework7-react

And after that continue build process

But I'm not 100% this helps

ShockwaveNN avatar Oct 29 '22 08:10 ShockwaveNN

Our developers said that there is a possible workaround

Remove web-apps\vendor\framework7-react\node_modules folder and run npm install in web-apps\vendor\framework7-react

And after that continue build process

But I'm not 100% this helps

Yes, still no luck.

qianwch avatar Oct 29 '22 11:10 qianwch

which version of nodejs and npm do you use?

maxkadushkin avatar Oct 29 '22 13:10 maxkadushkin

The nodejs and npm is auto installed by build_tools, v10.24.1 and 6.14.17.

qianwch avatar Oct 29 '22 13:10 qianwch

Now it worked, I need to install nodejs 12.22.12, then run ./automate.py server It seems that the build script needs to be updated as nodejs 10 does not work.

qianwch avatar Oct 30 '22 04:10 qianwch

Glad that you've figure it out, but there is still some bug

Since we planned that mobile viewers should work with default build config (with nodejs 10)

I've created issue 59569 in our private issue tracker to figure it out

ShockwaveNN avatar Oct 31 '22 06:10 ShockwaveNN

Hello @qianwch, sorry for the late reply. It's fixed some time ago, we up node version to 16.

igwyd avatar May 17 '24 06:05 igwyd

I close this issue. Feel free to comment or reopen it if you got further questions.

Rita-Bubnova avatar May 17 '24 10:05 Rita-Bubnova