Do I need to do something more about the Editor Sync ?
by user 224464722878005248
Do I need to do something more about the Editor Sync ?
by user 224464722878005248
Nop
by user 224464722878005248
How does your vite config look like now? It looks like our plugin is not actually loaded
import * as path from 'path';
import { defineConfig, optimizeDeps } from 'vite';
import viteCompression from 'vite-plugin-compression';
import basicSsl from '@vitejs/plugin-basic-ssl'
import react from '@vitejs/plugin-react'
export default defineConfig(async ({ command }) => {
const { needlePlugins, useGzip, loadConfig } = await import("@needle-tools/engine/plugins/vite/index.js")
const needleConfig = await loadConfig()
return {
base: "./",
// publicDir: "./assets", // this would copy all assets in the outdir (but not inside assets)
assetsInclude: ['*'],
// logLevel: 'info',
plugins: [
react(),
needlePlugins(command, needleConfig),
basicSsl(),
//viteCompression({ deleteOriginFile: true }),
],
server: {
// hmr: false,
// watch: ["generated/**"]
https: true,
proxy: { // workaround: specifying a proxy skips HTTP2 which is currently problematic in Vite since it causes session memory timeouts.
'https://localhost:3000': 'https://localhost:3000'
},
watch: {
awaitWriteFinish: {
stabilityThreshold: 500,
pollInterval: 1000
},
},
strictPort: true,
},
build: {
outDir: "./dist",
emptyOutDir: true,
keepNames: true,
},
resolve: {
alias: {
'three': () => {
const absPath = path.resolve(__dirname, 'node_modules/three');
return absPath;
},
'@needle-tools/engine': () => {
const absPath = path.resolve(__dirname, 'node_modules/@needle-tools/engine');
return absPath;
},
'react': () => {
const absPath = path.resolve(__dirname, 'node_modules/react');
return absPath;
}
}
}
}
});
by user 224464722878005248
will take a look now and update the template
Mmmh updated the vite config and versions in the react template and works with no other changes
That error points to an super old engine version? 2.60.4 ?
Can you check you node_modules/@needle-tools/engine folder and the package.json in your project? What paths are entered there? Can you show that?
If 2.60. is installed it makes sense that it doesnt work
I think you right… there is an error on the package gestiannary on unity
Here my package.json :
by user 224464722878005248
{
“name”: “my-project”,
“version”: “1.0.0”,
“scripts”: {
“start”: “vite --host”,
“pre-build”: “tsc”,
“build:dev”: “tsc && vite build && npm run copy-files”,
“build:production”: “npm run build:dev && npm run pack-gltf”,
“serve”: “vite preview”,
“copy-files”: “copy-files-from-to”,
“pack-gltf”: “npm run pack-gltf --prefix node_modules/@needle-tools/engine”
},
“dependencies”: {
“@emotion/react”: “^11.10.5”,
“@emotion/styled”: “^11.10.5”,
“@mui/material”: “^5.11.7”,
“@needle-tools/engine”: “file:…/…/Library/PackageCache/com.needle.engine@2.60.4-pre/package~”,
“@vitejs/plugin-basic-ssl”: “^0.1.2”,
“comlink”: “^4.4.0”,
“dat.gui”: “^0.7.9”,
“gsap”: “^3.11.4”,
“react”: “^18.0.0”,
“react-dom”: “^18.0.0”,
“styled-components”: “^5.3.6”,
“three”: “file:…/…/Library/PackageCache/com.needle.engine@2.66.1-pre/package~/node_modules/three”,
“three-bvh-csg”: “^0.0.4”,
“typestyle”: “^2.4.0”,
“unstated-next”: “^1.1.0”
},
“devDependencies”: {
“@gltf-transform/cli”: “^2.1.7”,
“@gltf-transform/functions”: “^2.1.7”,
“@needle-tools/editor-sync”: “^1.0.0-pre”,
“@types/three”: “0.146.0”,
“@vitejs/plugin-react”: “^1.3.0”,
“ansi-styles”: “^6.1.0”,
“copy-files-from-to”: “^3.3.0”,
“eslint-plugin-react-hooks”: “^4.5.0”,
“typescript”: “^4.5.5”,
“vite”: “^3.1.4”,
“vite-plugin-compression”: “^0.3.6”
},
“copyFiles”: [
{
“from”: “assets//.",
“to”: “dist/assets/”
},
{
“from”: "node_modules/@needle-tools/engine/src/include//.”,
“to”: “dist/include/”
},
{
“from”: “include/**/.”,
“to”: “dist/include/”
}
]
}
by user 224464722878005248
"@needle-tools/engine": "file:../../Library/PackageCache/com.needle.engine@2.60.4-pre/package~",
by user 224464722878005248
Can you try removing the path (leave it empty) and run install again? (It should auto-fill the correct path
Yep, I will, thanks
by user 224464722878005248
I’ve seen this happen a few times when unity didnt delete the old folder (we only change local paths when they dont exist, usually unity should delete older package versions but sometimes that seems to fail)
It’s actually one of the bigger changes coming to the next major update (no more local paths)
Buuuut with the correct version it should work now too