Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-8791

Update Fragment dependencies to use Yarn and work around NodeJS 15 bug

    Details

      Description

      Fragment imports using the Fragments Toolkit with NodeJS 15 fail as demonstrated below. This is caused by https://github.com/node-fetch/node-fetch/issues/739 in NodeJS.

      Users can work around this issue by using NodeJS 14 or 12. If they're currently using NodeJS15, they must update their environment to use NodeJS14 or 12.

      The setup_tutorial.sh script should be updated to guide users in doing this.

      Error:

      $ npm run import
      
      > x2y6@ import /home/jhinkey/examples/liferay-x2y6
      > yo liferay-fragments:import
      
      ? Liferay host & port http://localhost:8080
      ? Username test@liferay.com
      ? Password [hidden]
      Checking connection...
      Connection successful
      
      ? Company ID liferay.com
      ? Group ID Liferay
      Building project...
      Importing project...
      TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received type boolean (false)
          at new NodeError (node:internal/errors:278:15)
          at write_ (node:_http_outgoing:711:11)
          at ClientRequest.write (node:_http_outgoing:676:15)
          at FormData.ondata (node:internal/streams/legacy:20:31)
          at FormData.emit (node:events:376:20)
          at FormData.EventEmitter.emit (node:domain:470:12)
          at FormData.CombinedStream.write (/home/jhinkey/.npm-global/lib/node_modules/generator-liferay-fragments/node_modules/combined-stream/lib/combined_stream.js:138:8)
          at FormData.CombinedStream._pipeNext (/home/jhinkey/.npm-global/lib/node_modules/generator-liferay-fragments/node_modules/combined-stream/lib/combined_stream.js:126:8)
          at FormData.CombinedStream._realGetNext (/home/jhinkey/.npm-global/lib/node_modules/generator-liferay-fragments/node_modules/combined-stream/lib/combined_stream.js:99:10)
          at FormData.CombinedStream._getNext (/home/jhinkey/.npm-global/lib/node_modules/generator-liferay-fragments/node_modules/combined-stream/lib/combined_stream.js:82:12)
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! x2y6@ import: `yo liferay-fragments:import`
      npm ERR! Exit status 1
      npm ERR! 
      npm ERR! Failed at the x2y6@ import script.
      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
      npm WARN Local package.json exists, but node_modules missing, did you mean to install?
      
      npm ERR! A complete log of this run can be found in:
      npm ERR!     /home/jhinkey/.npm/_logs/2021-01-05T19_36_02_001Z-debug.log
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brian.chan Brian Chan
              Reporter:
              james.hinkey James Hinkey
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support

                    Packages

                    Version Package
                    7.2.x
                    7.3.x