Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

king_eke's avatar

Edge browser spread operator not working for laravel react

Hello, i'm running my laravel react app on edge browser but getting an

Expected identifier, string or number

on a spread operator in the app.js which shows this

_getConfig(config) {
    config = {
      ...Default,
      ...config
    }

this is my .babelrc

{
    "presets": [
        [
            "@babel/preset-env",
            {
                "targets": {
                    "edge": "17",
                    "firefox": "60",
                    "chrome": "67",
                    "safari": "11.1"
                },
                "useBuiltIns": "usage"
            }
        ],
        "@babel/preset-react"
    ],
    "plugins": [
        "@babel/plugin-proposal-class-properties",
        "@babel/plugin-proposal-object-rest-spread",
        "@babel/plugin-transform-destructuring",
        "@babel/plugin-transform-template-literals"
    ]
}

please any help will be appreciated

0 likes
2 replies
Tray2's avatar

The spread feature is not supported in Edge but babel should be able to handle that.

king_eke's avatar

@tray2 It should, i expect it to convert it to es2015, but it doesn't do anything. Can you assist please and what file do i need to show you so you can help please ?

Please or to participate in this conversation.