Legacy Knowledge Base
Published Sep. 10, 2025

"Primordial" ReferenceError is thrown when upgrading or importing the theme

Written By

Thanga Meena

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Error as "ReferenceError: primordials is not defined" is thrown either while upgrading a theme or when importing a theme
home/xxxx/yyyyy/theme$ yo liferay-theme:import
00h00m00s 0/0: : fs.js:27
const { Math, Object } = primordials;
                        ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (/usr/lib/node_modules/generator-liferay-theme/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/usr/lib/node_modules/generator-liferay-theme/node_modules/natives/index.js:55:10)

Environment

  • Liferay DXP 7.0 and higher

Resolution

Please Note: The following steps involve third-party tool that lies beyond the scope of Liferay Support.  Please exercise appropriate discretion in the use of this information.

  • Installing the specific node version resolves the primordial error. Please refer to the below steps.

Steps to follow:

  • Install the specific node version [For ex: v10.15.1]
    home/xxxx/yyyyy/theme$ sudo n 10.15.1
  • Then try to import a theme or upgrade a theme.
home/xxxx/yyyyy/theme$ yo liferay-theme:import
00h00m00s 0/0: :
    _-----_
    |      |    .--------------------------.
    |--(o)--|    |  Welcome to the splendid |
  `---------´  |  Liferay Theme Importer  |
    ( _´U`_ )    |        generator!        |
    /___A___\    '--------------------------'
    |  ~  |   
  __'.___.'__ 
 ´  `  |° ´ Y `

? May generator-liferay-theme anonymously report usage statistics to improve the tool over time? Yes
? What theme would you like to import? /home/meena/Desktop/FIles_theme_upgrade/upgrade70/Theme61-70/Theme61/Theme61x-theme
  Warning could not determine the property <template-extension> from /home/meena/Desktop/FIles_theme_upgrade/upgrade70/Theme61-70/Theme61/Theme61x-theme/docroot/WEB-INF/liferay-look-and-feel.xml. Using ftl as default value.
  create package.json
  create .gitignore
  create gulpfile.js
  create src/css/custom.css
  create src/WEB-INF/liferay-look-and-feel.xml
  create src/WEB-INF/liferay-plugin-package.properties
...............
? Enter the url to your production or development site: http://localhost:8080
[15:49:21] Finished 'plugin:init' after 1.37 min
[15:49:21] Starting 'init'...
[15:49:21] Finished 'init' after 54 μs
Did this article resolve your issue ?

Legacy Knowledge Base