Uploaded image for project: 'eZ Platform Enterprise Edition'
  1. eZ Platform Enterprise Edition
  2. EZEE-1850

StudioUI doesn't work if symfony/webpack-encore is configured to use json_manifest.

    XMLWordPrintable

Details

    Description

      It is impossible to enter Page mode when framework.assets is set to json_manifest_path. This is core Symfony feature since 3.3.

      More information about this feature: https://symfony.com/blog/new-in-symfony-3-3-manifest-based-asset-versioning

      Steps to reproduce:
      1) Create clean eZ Platform EE v2 instance,
      2) Install symfony/webpack-encore*
      3) Create webpack.config.js*
      4) Set configuration key framework.assets to json_manifest_path: '%kernel.project_dir%/web/build/manifest.json' (use path which you defined in webpack.config.js).
      5) Login to admin interface
      6) Go to the Page tab

      You should see a warning:

      Warning: preg_replace(): Unknown modifier '/'
      

      Thanks to the customer you can see the whole exception page as a screenshot in the attachment.


      symfony/webpack-encore installation:
      1) from the project root directory execute:

      npm install @symfony/webpack-encore --save-dev
      

      2) create webpack.config.js file in the project root directory, with content:

      // webpack.config.js
      var Encore = require('@symfony/webpack-encore');
      
      Encore
      // the project directory where all compiled assets will be stored
          .setOutputPath('web/build/')
      
          // the public path used by the web server to access the previous directory
          .setPublicPath('/build')
      
          // will create web/build/app.js and web/build/app.css
          .addEntry('app', './web/js/7b50630.js')
      
          .enableSourceMaps(!Encore.isProduction())
      
          // empty the outputPath dir before each build
          .cleanupOutputBeforeBuild()
      
      // create hashed filenames (e.g. app.abc123.css)
      // .enableVersioning()
      ;
      
      // export the final configuration
      module.exports = Encore.getWebpackConfig();
      

      Note: You can safely choose other file in .addEntry('app', './web/js/7b50630.js') actually it doesn't matter in the context of this bug.
      3) Run webpack:

      ./node_modules/.bin/encore dev --context=path/to/your/project/root/dir
      

      Note: If you want to run webpack for prod then change dev to production.

      more: http://symfony.com/doc/3.4/frontend/encore/installation.html & http://symfony.com/doc/3.4/frontend/encore/simple-example.html

      Attachments

        Activity

          People

            Unassigned Unassigned
            kamil.madejski@ibexa.co Kamil Madejski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: