install subtheme not working (unexpected end of json input)

Created on 1 December 2024, 3 months ago

Installing with drush or nmp generates an error. I use npm 10.9.0 (node 23.2.0) under ubuntu 24.04 LTS.

drush --include="web/themes/contrib/artisan" xxx

[error]  Ups, something failed, please try it manually "cd 
/home/XXX/webapps/XXX_dev/web/themes/custom/xxx" and "npm run production"

npm run production

> xxx@1.0.1 production
> mix --production


āœ– Mix
  Compiled with some errors in 2.64s

38 WARNINGS in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)

ERROR in ./node_modules/@popperjs/core/lib/index.js + 56 modules
Unexpected end of JSON input

webpack compiled with 1 error and 38 warnings
šŸ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

šŸ‡ØšŸ‡­Switzerland snsblvd

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

Comments & Activities

  • Issue created by @snsblvd
  • šŸ‡ØšŸ‡­Switzerland snsblvd
  • šŸ‡ØšŸ‡­Switzerland snsblvd
  • šŸ‡ŖšŸ‡øSpain tunic Madrid

    I'm not able to reproduce this bug. I've tried using node 23.4.0 but it compiles without errors. I'm using DDEV and Aljibe (https://github.com/Metadrop/ddev-aljibe/), but anyway it should work the same with any environment as long as the Artisan release and node are similar.

    Can you try using Aljibe and/or DDEV? To discard problems on your local setup.

  • Thanks for reporting, that error seems related to popper bootstrap 5.3 dependency ("for positioning dropdowns, poppers, and tooltips"), theme dependency is the same as suggested per bootstrap "^2.11.8": https://git.drupalcode.org/project/artisan/-/blob/1.x/artisan_starterkit...

    https://getbootstrap.com/docs/5.3/getting-started/introduction/

    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
    

    Genrated "package-lock.json" expected generation for popperjs:

    "node_modules/@popperjs/core": {
          "version": "2.11.8",
          "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
          "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
          "dev": true,
          "license": "MIT",
          "funding": {
            "type": "opencollective",
            "url": "https://opencollective.com/popperjs"
          }
        },
    

    When that happens you should be able to manage it manually, command is just a helper that will try to simplify process. So if that happens new theme folder should exists either way, but you will have to enable serialization module dependency & default theme manually.

    As tunic said, i'm not able to reproduce this bug either, feel free to change status if you found new details to replicate.

  • Status changed to Postponed: needs info about 1 month ago
  • šŸ‡ØšŸ‡¦Canada mandclu

    I just tried installing this theme for the first time, and I also got a failure at the compile step. Here is the output:

     [notice] Compiling theme, please wait...
    
    In Process.php line 1182:
    
      The process "npm install" exceeded the timeout of 60 seconds.
    
    
    Failed to run drush --include=web/themes/contrib/artisan artisan: exit status 1
    āžœ  artisan npm -v
    10.9.2
    

    I tried installing the theme through the UI, but then got multiple errors like this:

    Warning: file_get_contents(themes/custom/artisanal/build/js/bs-dropdown.js): Failed to open stream: No such file or directory in Drupal\system\Controller\JsAssetController->generateHash() (line 43 of core/lib/Drupal/Core/Asset/AssetGroupSetHashTrait.php).
    Drupal\system\Controller\JsAssetController->generateHash() (Line: 184)
    Drupal\system\Controller\AssetControllerBase->deliver()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

    It also couldn't find script.js.

  • šŸ‡ØšŸ‡¦Canada mandclu

    If I go to the subtheme folder and run npm install manually, this is the output:

    āžœ  artisanal npm install
    npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
    npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
    npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
    npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
    npm warn deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
    
    added 833 packages, and audited 834 packages in 21s
    
    102 packages are looking for funding
      run `npm fund` for details
    
    5 vulnerabilities (2 low, 3 moderate)
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.
    
Production build 0.71.5 2024