"npm run build" exits with errors

Created on 7 March 2025, 28 days ago

Problem/Motivation

"npm run build" exits with errors

PHP Fatal error: Uncaught TypeError: ini_set() expects parameter 2 to be string, int given in /web/themes/contrib/civictheme/civictheme_starter_kit/scripts/add_phpcs_exclusions.php:144
Stack trace:
#0 /web/themes/contrib/civictheme/civictheme_starter_kit/scripts/add_phpcs_exclusions.php(144): ini_set('display_errors', 1)
#1 {main}
thrown in /web/themes/contrib/civictheme/civictheme_starter_kit/scripts/add_phpcs_exclusions.php on line 144

Fatal error: Uncaught TypeError: ini_set() expects parameter 2 to be string, int given in /web/themes/contrib/civictheme/civictheme_starter_kit/scripts/add_phpcs_exclusions.php:144
Stack trace:
#0 /web/themes/contrib/civictheme/civictheme_starter_kit/scripts/add_phpcs_exclusions.php(144): ini_set('display_errors', 1)
#1 {main}
thrown in /web/themes/contrib/civictheme/civictheme_starter_kit/scripts/add_phpcs_exclusions.php on line 144

πŸ› Bug report
Status

Active

Version

1.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States gmarez8

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gmarez8
  • πŸ‡ΊπŸ‡ΈUnited States gmarez8

    Forgot to add, Node v20.14.0. Latest CivicTheme version, Latest Drupal 10 version.

  • πŸ‡ΊπŸ‡ΈUnited States gmarez8

    Hi, I wanted to follow up on this. Will the theme still be usable if I am unable to build and run? Will I have to make a child theme manually?

  • πŸ‡¦πŸ‡ΊAustralia alan.cole

    You will need to be able to build the theme for it to work properly.

    The issue you're seeing is likely due to using an old PHP version. I can see on the docs: https://www.php.net/manual/en/function.ini-set.php

    that Since PHP 8.1.0 `ini_set` supports more than just string values. I'm assuming you're on an older version so it's throwing an error as the call to `ini_set` is passing in an integer.

  • πŸ‡ΊπŸ‡ΈUnited States gmarez8

    Alan, thank you.
    php -i results:
    phpinfo()
    PHP Version => 7.4.33

    However, ddev config has php_version: "8.3" set.

    So instead I ran "ddev npm run build" and it was successful.

    Ticket can be closed. Thank you again!

  • Hi @gmarez8, I'll close this ticket, thanks for letting us know.
    CivicTheme is on Drupal slack, which is a great place to ask questions like this and saves you raising a ticket. Find the Drupal slack channel, then look for #civictheme-designsystem. Alan and other CivicTheme devs are on that channel.

Production build 0.71.5 2024