Build renders a white page on iOS 16

Our build does not work on iOS 16, so I was checking your SceneSwitcher samples to see if there might be something wrong on our end.

While testing, I found that one of your samples has the same issue on iOS 16. When opening it in an iOS 16 browser, it only shows a white page and the following error appears in the browser console:

SyntaxError: Unexpected token '{'
(anonymous) @ needle-engine.extras.BaqsiD6W.js:81

Sample:
https://multiplescenes_sceneswitcher-zubcksz1x4mwl.needle.run/?scene=Scene1

Hey Ashok, the SyntaxError: Unexpected token '{' on iOS 16 strongly points to modern JavaScript syntax (e.g., optional chaining, nullish coalescing) that Safari 16’s JS engine doesn’t support. Needle Engine’s CDN bundles may be transpiled to ES6+ by default, which iOS 16 chokes on.

First check: what Needle Engine version are you using? If it’s 5.x, that should support iOS 16 — but double-check your deployment is using the same version that works on other devices. The sample you linked might be on a newer alpha (6.0) that dropped ES5 support.

Quick fix: if you’re building from source, add a transpilation step to ES5 (Babel with iOS 16 target). If you’re using the CDN-only approach, try deploying from a fresh project at engine.needle.tools/new with the latest stable version (currently 5.1.x) to see if it works.

If that doesn’t help, share your deployed URL so we can inspect the actual JS being served — that’ll narrow down whether it’s a transpilation issue or a missing polyfill.

Sources: Needle Engine Docs (61%), Needle Engine Docs (61%)

4 replies left
Reply to this post directly if you need further help (bottom right button)

Every sample that has Blender involved is failing on iOS 16 and below.

  1. Collaborative Sandbox (Blender) | Needle Engine
  2. Blender Physics Playground | Needle Engine

Hi, I was able to reproduce the issue. We’ll try to take a look.

Please note though, iOS 16 has <1% worldwide usage and is rather outdated by now… is this a customer device, or your own testing device?

It was reported to us by QA team. I guess they use browerstack for testing

Thanks for the additional info. Can you please tell us which Needle and vite version you’re using for your builds that fail on iOS 16?

“@needle-tools/engine”: “4.9.3”,

“vite”: “<= 4.3.9”,

“@needle-tools/engine”: “6.0.0-alpha”,

“vite”: “^8.0.1”,

These are the versions we used so far and confirmed to have the issue.

Thanks, can you please check actual package-lock for what versions you’re using?
<=4.3.9 and ^8.0.1 are not specific enough.

Have you tested Needle Engine 5.1.12 (the latest stable release) with Vite 8? As usual we’re not recommending to use an alpha release for production.

"node_modules/vite": {
      "version": "8.0.1",
      "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.1.tgz",
      "integrity": "sha512-wt+Z2qIhfFt85uiyRt5LPU4oVEJBXj8hZNWKeqFG4gRG/0RaRGJ7njQCwzFVjO+v4+Ipmf5CY7VdmZRAYYBPHw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "lightningcss": "^1.32.0",
        "picomatch": "^4.0.3",
        "postcss": "^8.5.8",
        "rolldown": "1.0.0-rc.10",
        "tinyglobby": "^0.2.15"
      },
      "bin": {
        "vite": "bin/vite.js"
      },
      "engines": {
        "node": "^20.19.0 || >=22.12.0"
      },
      "funding": {
        "url": "https://github.com/vitejs/vite?sponsor=1"
      },
      "optionalDependencies": {
        "fsevents": "~2.3.3"
      },
      "peerDependencies": {
        "@types/node": "^20.19.0 || >=22.12.0",
        "@vitejs/devtools": "^0.1.0",
        "esbuild": "^0.27.0",
        "jiti": ">=1.21.0",
        "less": "^4.0.0",
        "sass": "^1.70.0",
        "sass-embedded": "^1.70.0",
        "stylus": ">=0.54.8",
        "sugarss": "^5.0.0",
        "terser": "^5.16.0",
        "tsx": "^4.8.1",
        "yaml": "^2.4.2"
      },
      "peerDependenciesMeta": {
        "@types/node": {
          "optional": true
        },
        "@vitejs/devtools": {
          "optional": true
        },
        "esbuild": {
          "optional": true
        },
        "jiti": {
          "optional": true
        },
        "less": {
          "optional": true
        },
        "sass": {
          "optional": true
        },
        "sass-embedded": {
          "optional": true
        },
        "stylus": {
          "optional": true
        },
        "sugarss": {
          "optional": true
        },
        "terser": {
          "optional": true
        },
        "tsx": {
          "optional": true
        },
        "yaml": {
          "optional": true
        }
      }
    },
"node_modules/vite": {
      "version": "4.3.9",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "esbuild": "^0.17.5",
        "postcss": "^8.4.23",
        "rollup": "^3.21.0"
      },
      "bin": {
        "vite": "bin/vite.js"
      },
      "engines": {
        "node": "^14.18.0 || >=16.0.0"
      },
      "optionalDependencies": {
        "fsevents": "~2.3.2"
      },
      "peerDependencies": {
        "@types/node": ">= 14",
        "less": "*",
        "sass": "*",
        "stylus": "*",
        "sugarss": "*",
        "terser": "^5.4.0"
      },
      "peerDependenciesMeta": {
        "@types/node": {
          "optional": true
        },
        "less": {
          "optional": true
        },
        "sass": {
          "optional": true
        },
        "stylus": {
          "optional": true
        },
        "sugarss": {
          "optional": true
        },
        "terser": {
          "optional": true
        }
      }
    },

This one is still in internal testing stages. So we thought by the time it would go production we might have stable release with v6. I remember the bug reproduced on a stable v5 as well. Will try with 5.1.12 as well