If you’re upgrading OneJS between major versions (via any of the installation methods outlined in the Getting Started guide), you may need to reset some default config files. Here’s the list:
package.jsontsconfig.jsonesbuild.mjspostcss.config.jstailwind.config.js
Just delete these from your WorkingDir (by default, that’s {ProjectDir}/App), then run your scene with the ScriptEngine prefab. OneJS will auto-generate fresh versions of those files with the latest defaults. If you’ve made custom changes, be sure to back them up first.
OneJS V1 to V2 Upgrade Notes
- Most of the DOM APIs from V1 still work the same in V2, so you probably won’t need to change much there.
- The
Objectslist onScriptEnginehas been replaced withGlobals. That means you don’t need to dorequire("myObj")anymore. You can just usemyObjdirectly in your JS code. - If you were using any Jint-specific code, you’ll need to update that to work with PuerTS instead.
TS Typing Issues
Generally you want to make sure to npm i onejs-core@latest to get the latest typings even if you are using an old Unity version. We try to provide the ts typings in a backwards-compatible way as much as possible, but sometimes there are breaking changes in the Unity API that we need to reflect in the typings. If you can’t seem to get past a typing issue, feel free to drop by our Discord server for help.