79158758

Date: 2024-11-05 10:55:27
Score: 0.5
Natty:
Report link

I've just added PR which should fix the issue: https://github.com/sulu/sulu/pull/7639

Problem is in babel loading, as @Alexander Schranz suggested.

In the meantime, until PR get's merged, you can also modify your local webpack.config.js inside admin assets folder and rebuild admin (don't replace your local webpack.config.js when prompted):

/* eslint-disable flowtype/require-valid-file-annotation */
/* eslint-disable import/no-nodejs-modules*/
/* eslint-disable no-undef */
const path = require('path');
const webpackConfig = require('../../vendor/sulu/sulu/webpack.config.js');

module.exports = (env, argv) => {
    env = env ? env : {};
    argv = argv ? argv : {};

    env.project_root_path = path.resolve(__dirname, '..', '..');
    env.node_modules_path = path.resolve(__dirname, 'node_modules');

    const config = webpackConfig(env, argv);
    config.entry = path.resolve(__dirname, 'index.js');

    config.module.rules = config.module.rules.map((rule) => {
        if (rule?.use?.loader === 'babel-loader') {
            let exclude = [rule.exclude, /friendsofsymfony\/jsrouting-bundle/];
            rule.exclude = exclude;
        }
        return rule;
    });

    return config;
};
Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Alexander
  • Low reputation (1):
Posted by: bmandl