needle-tools / needle-engine-support

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible and includes networking and XR - across platforms. Documentation at https://docs.needle.tools
545 stars 45 forks source link

Error: ENOENT: no such file or directory, open 'node_modules/three/examples/jsm/objects/GroundProjectedEnv.js' #75

Closed ROBYER1 closed 2 years ago

ROBYER1 commented 2 years ago

Using Unity 2022.1.16f1, updated to Exporter 2.26.0-pre

Hitting play gives me this now, needing to roll back a version now

(this will be run only when your dependencies or config have changed)
error when starting dev server:
Error: ENOENT: no such file or directory, open 'C:/Unity_Projects/ProjName/Projects/newProject/node_modules/three/examples/jsm/objects/GroundProjectedEnv.js'
    at Object.openSync (node:fs:594:3)
    at Object.readFileSync (node:fs:462:35)
    at optimizeDeps (C:\Unity_Projects\ProjName\projects\newProject\node_modules\vite\dist\node\chunks\dep-3e244802.js:63021:42)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOptimize (C:\Unity_Projects\ProjName\projects\newProject\node_modules\vite\dist\node\chunks\dep-3e244802.js:66813:48)
    at async Server.httpServer.listen (C:\Unity_Projects\ProjName\projects\newProject\node_modules\vite\dist\node\chunks\dep-3e244802.js:66829:21)
marwie commented 2 years ago

Hey did installation run after updating?

marwie commented 2 years ago

Another thing that would be cool if you could check is if the installed three version is correct. I'm just seeing a wrong three version being installed in one of my projects while in the samples repository I updated yesterday it installed the correct version (and I was able to run and build a sample using groundprojection there without problems)

would be great if you could send a screenshot of the content of the package json here: image

ROBYER1 commented 2 years ago

Contents of that package, I tried running install after upgrading back up to it again, same issue as before when playing

{
  "name": "three",
  "version": "0.141.0",
  "description": "JavaScript 3D library",
  "type": "module",
  "main": "./build/three.js",
  "module": "./build/three.module.js",
  "exports": {
    ".": {
      "import": "./build/three.module.js",
      "require": "./build/three.cjs"
    },
    "./examples/fonts/*": "./examples/fonts/*",
    "./examples/jsm/*": "./examples/jsm/*",
    "./src/*": "./src/*"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/mrdoob/three.js"
  },
  "sideEffects": false,
  "files": [
    "build/three.js",
    "build/three.cjs",
    "build/three.min.js",
    "build/three.module.js",
    "examples/js",
    "examples/jsm",
    "examples/fonts",
    "LICENSE",
    "package.json",
    "README.md",
    "src"
  ],
  "directories": {
    "doc": "docs",
    "example": "examples",
    "test": "test"
  },
  "eslintConfig": {
    "root": true,
    "extends": [
      "mdcs",
      "plugin:compat/recommended"
    ],
    "parser": "@babel/eslint-parser",
    "parserOptions": {
      "babelOptions": {
        "configFile": "./utils/build/.babelrc.json"
      }
    },
    "plugins": [
      "html",
      "import"
    ],
    "settings": {
      "polyfills": [
        "WebGL2RenderingContext"
      ]
    },
    "globals": {
      "__THREE_DEVTOOLS__": "readonly",
      "WebGL2ComputeRenderingContext": "readonly",
      "potpack": "readonly",
      "fflate": "readonly",
      "bodymovin": "readonly",
      "OIMO": "readonly",
      "Stats": "readonly",
      "XRWebGLBinding": "readonly",
      "XRWebGLLayer": "readonly",
      "GPUShaderStage": "readonly",
      "GPUBufferUsage": "readonly",
      "GPUTextureUsage": "readonly",
      "QUnit": "readonly"
    },
    "rules": {
      "no-throw-literal": [
        "error"
      ],
      "import/extensions": [
        "error",
        "always"
      ],
      "quotes": [
        "error",
        "single"
      ],
      "prefer-const": [
        "error",
        {
          "destructuring": "any",
          "ignoreReadBeforeAssign": false
        }
      ]
    }
  },
  "browserslist": [
    "> 1%, not dead, not ie 11, not op_mini all"
  ],
  "scripts": {
    "start": "npm run dev",
    "test": "npm run lint && npm run test-unit",
    "build": "rollup -c utils/build/rollup.config.js",
    "build-module": "ONLY_MODULE=true rollup -c utils/build/rollup.config.js",
    "build-examples": "rollup -c utils/build/rollup.examples.config.js && echo '\nFormatting...' && eslint examples/js --ext js --ignore-pattern libs --ignore-pattern ifc --fix",
    "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
    "lint": "eslint src --ext js",
    "lint-examples": "eslint examples/js examples/jsm --ext js --ignore-pattern libs --ignore-pattern ifc",
    "lint-fix": "npm run lint -- --fix && npm run lint-examples -- --fix",
    "lint-docs": "eslint docs --ext html",
    "test-unit": "npm run unit --prefix test",
    "test-e2e": "node test/e2e/puppeteer.js",
    "test-e2e-cov": "node test/e2e/check-coverage.js",
    "test-treeshake": "rollup -c test/rollup.treeshake.config.js",
    "make-screenshot": "node test/e2e/puppeteer.js --make"
  },
  "keywords": [
    "three",
    "three.js",
    "javascript",
    "3d",
    "virtual-reality",
    "augmented-reality",
    "webgl",
    "webgl2",
    "webaudio",
    "webgpu",
    "webxr",
    "canvas",
    "svg",
    "html5"
  ],
  "author": "mrdoob",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/mrdoob/three.js/issues"
  },
  "homepage": "https://threejs.org/",
  "devDependencies": {
    "@babel/core": "^7.18.2",
    "@babel/eslint-parser": "^7.18.2",
    "@babel/plugin-proposal-class-properties": "^7.17.12",
    "@babel/preset-env": "^7.18.2",
    "@rollup/plugin-babel": "^5.3.1",
    "@rollup/plugin-node-resolve": "^13.3.0",
    "chalk": "^5.0.1",
    "concurrently": "^7.2.1",
    "eslint": "^8.16.0",
    "eslint-config-mdcs": "^5.0.0",
    "eslint-plugin-compat": "^4.0.2",
    "eslint-plugin-html": "^6.2.0",
    "eslint-plugin-import": "^2.26.0",
    "rollup": "^2.75.0",
    "rollup-plugin-filesize": "^9.1.2",
    "rollup-plugin-terser": "^7.0.2",
    "rollup-plugin-visualizer": "^5.6.0",
    "servez": "^1.14.1"
  },
  "jspm": {
    "files": [
      "package.json",
      "LICENSE",
      "README.md",
      "build/three.js",
      "build/three.min.js",
      "build/three.module.js"
    ],
    "directories": {}
  }
}
marwie commented 2 years ago

Thank you! yes that's the wrong version too there. It doesnt contain the GroundProjection. So it is the same problem I have here right now. Trying to figure out why npm doesnt install the new three branch

marwie commented 2 years ago

Can you try updating to 2.27.1-pre and see if it is fixed there? It should run npm update three automatically and after that have the correct version

ROBYER1 commented 2 years ago

Can you try updating to 2.27.1-pre and see if it is fixed there? It should run npm update three automatically and after that have the correct version

Updated to that, still got the same error after an install...

ROBYER1 commented 2 years ago

Trying the next pre.1 one

marwie commented 2 years ago

Did you see a log in the console saying it would run npm update ? Could you try restarting Unity after updating if you dont?

ROBYER1 commented 2 years ago

Exporter 2.27.1-pre.1 fixes this

marwie commented 2 years ago

Thanks