# Face Filter sample: Stuck on loading on engine 5.x / Vite 8 (workaround included)

**URL:** <https://forum.needle.tools/t/face-filter-sample-stuck-on-loading-on-engine-5-x-vite-8-workaround-included/2904>\
**Category:** 🌵 Needle Engine\
**Tags:** question, bug\
**Created:** [October 1, 2026, 3:56pm UTC](https://forum.needle.tools/t/face-filter-sample-stuck-on-loading-on-engine-5-x-vite-8-workaround-included/2904 "2026-10-01T15:56:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![winson\_xie](https://forum.needle.tools/user_avatar/forum.needle.tools/winson_xie/32/5028_2.png) [@winson\_xie](https://forum.needle.tools/u/winson_xie)\
**Post date:** [October 1, 2026, 3:56pm UTC](https://forum.needle.tools/t/face-filter-sample-stuck-on-loading-on-engine-5-x-vite-8-workaround-included/2904/1 "2026-10-01T15:56:01Z")

</div>

and decorator errors until tsconfigRaw is set. (\<\<Add to title)

Hi all, I’m new to Needle and used the “Needle Face Filter Examples” sample from Unity for a uni project. I hit a chain of problems that ended in a working setup. I’m posting the details in case they help others, and in case the sample or templates could be updated.

Setup

- Windows, Unity 6000.0.82f1, Node v22.20.0, BASIC (non-commercial) license
- Web project in Library/Needle/Sample
- Face filter: Unity side uses the local tarball com.needle.face-filter-1.0.0-beta.12.tgz (the registry returns an authentication error for com.needle.face-filter). Web side: @needle-tools/facefilter 1.0.4 from npm.

Symptoms and causes

1. Infinite white screen on engine 5.1.14 / 6.0.0-alpha.3 with Vite 8  
The dev server stopped at “bundling dependencies…” and the page never loaded. The default sandbox worked. I didn’t find the exact cause. It went away after I moved to the combination below.

2. Build error on engine 5.1.14: “hasProLicense is not exported”  
This appeared when building with the facefilter package, so it looks like a version mismatch between the facefilter package and the engine. It disappeared on engine 4.10.2.

3. Unity kept resolving the engine to 5.1.2  
com.needle.engine-samples 1.5.1 depends on com.needle.engine-exporter 5.1.2, which overrode my manifest.json entry of 4.10.2. I had to remove com.needle.engine-samples from Packages/manifest.json, delete Packages/packages-lock.json and reopen Unity.

4. Build error on engine 4.10.2 with Vite 8: “Failed to convert builtin plugin ‘ViteAlias’”  
Fixed with: npm i -D vite@7 (7.3.6). The FAQ currently says recent engine versions need Vite 8+, which seems to be true for 5.x but not for 4.10.2.

5. Runtime errors on engine 4.10.2 / Vite 7

- ReferenceError: Cannot access ‘\_ShaderToyFaceFilter’ before initialization

- TypeError: Cannot read properties of undefined (reading ‘\_\_internalAwake’)

- warnings about “@serializable without a target” and “Unknown components in scene”  
My tsconfig.json already had experimentalDecorators: true, but the facefilter package ships TypeScript source (main: index.ts) under node\_modules, and my guess is the project tsconfig isn’t applied to those files, so the decorators were compiled incorrectly. Setting tsconfigRaw directly in vite.config.js fixed it:

```auto
  esbuild: {
    tsconfigRaw: { compilerOptions: { experimentalDecorators: true, useDefineForClassFields: false } },
  },
  optimizeDeps: {
    esbuildOptions: {
      tsconfigRaw: { compilerOptions: { experimentalDecorators: true, useDefineForClassFields: false } },
    },
  },

```

Working combination

- @needle-tools/engine 4.10.2 (Unity package and npm)
- Vite 7.3.6, @vitejs/plugin-basic-ssl 2.3.0
- @needle-tools/facefilter 1.0.4 (npm), Unity face-filter package from the local beta.12 tarball
- Needle Engine Samples package removed
- tsconfigRaw added to vite.config.js as above  
With this the camera permission prompt appears and the face filter runs.

Questions

1. Is there a recommended engine/facefilter/Vite combination for the face filter sample on engine 5.x? Is a newer facefilter build planned?
2. Should the Vite config in the face filter template set tsconfigRaw (or should the package ship compiled JS)?
3. Is there a supported way to stop the Unity integration from overwriting vite.config.js and package.json in Library/Needle/Sample? I know the npm: prefix protects the engine version, but I couldn’t find anything about the other files.
4. Is the authentication error for com.needle.face-filter on packages.needle.tools expected?

I haven’t tested the production build (vite build / preview) after the fix, and I can’t be sure the root causes are exactly as I described.

Thanks!

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [October 1, 2026, 3:56pm UTC](https://forum.needle.tools/t/face-filter-sample-stuck-on-loading-on-engine-5-x-vite-8-workaround-included/2904/2 "2026-10-01T15:56:02Z")

</div>

The mixing is the problem: you’ve got the tarball `face-filter-1.0.0-beta.12` on the Unity side and `@needle-tools/facefilter@1.0.4` from npm on the web side. Those are different builds, and your “hasProLicense is not exported” error is the classic symptom of the web package expecting a different engine API than the one you’re running. Pin both sides to the same facefilter version — pull the web package at the beta.12 tag to match the tarball.

The decorator errors (and probably the hang during “bundling dependencies…”) are esbuild not seeing `experimentalDecorators`. That’s why `tsconfigRaw` fixes it: Vite’s dep-optimizer doesn’t read your `tsconfig.json` unless you pass it. Add to `vite.config.js`:

```js
esbuild: { tsconfigRaw: { compilerOptions: { experimentalDecorators: true } } }

```

One question: are you pinned to a specific engine version in `package.json`, or floating? If floating, what does `npm ls @needle-tools/engine` say?

Sources: [Needle Engine Docs](https://engine.needle.tools/docs/why.html#:~:text=Getting%20Started%20%E2%80%94%20pick%20Unity%2C%20Blender%2C%20or%20code.) (69%), [Needle Engine Docs](https://engine.needle.tools/docs/tutorials/scripting-walkthrough.html#:~:text=Learn%20Needle%20Engine%20scripting%20one%20idea%20at%20a%20time.) (65%), [Needle Engine Docs](https://engine.needle.tools/docs/unity/#:~:text=Component%20Reference%20-%20All%20built-in%20components) (64%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/scripting/examples.html#:~:text=That's%20the%20whole%20model%3A%20components%20on%20objects%2C%20a%20lifecycle%2C%20and%20a%20context%20they) (63%), [Needle Engine Docs](https://engine.needle.tools/docs/help/#:~:text=Need%20help%20with%20Needle%20Engine%3F) (63%), [Needle Engine Docs](https://engine.needle.tools/docs/reference/faq.html#:~:text=If%20you%20see%20an%20error%20like%20this%20after%20opening%20your%20web%20project%3A) (61%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/optimization/#:~:text=Problem%3A%20Production%20build%20fails%20during%20compression) (60%), [Needle Engine Docs](https://engine.needle.tools/docs/#:~:text=Build%203D%20web%20experiences%20that%20work%20everywhere.) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/xr/ios-webxr-app-clip.html#:~:text=Ensure%20that%20camera%20permissions%20are%20granted.) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/getting-started/#:~:text=Build%20fully%20interactive%203D%20websites%20using%20your%20favorite%20tools.) (58%)

_1 replies left_ - **[Become PRO](https://needle.tools/pricing)** for more replies.  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [October 2, 2026, 10:34am UTC](https://forum.needle.tools/t/face-filter-sample-stuck-on-loading-on-engine-5-x-vite-8-workaround-included/2904/3 "2026-10-02T10:34:53Z")

</div>

Hi,

Thanks for the detailed report and questions. Will forward it to the team!

Please don’t start multiple forum posts for the same issue tho! I see you created 3 posts around that topic.

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [October 6, 2026, 3:28pm UTC](https://forum.needle.tools/t/face-filter-sample-stuck-on-loading-on-engine-5-x-vite-8-workaround-included/2904/4 "2026-10-06T15:28:45Z")

</div>

Hello, the issue should be fixed in facefilter version 1.0.5. Could you try again with that version and let me know if it works for you with Needle Engine 5 or 6?
