Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Property 'name' does not exist on type 'Container'. #10571

Open
GuillaumeCLProdigy opened this issue May 22, 2024 · 2 comments
Open

Bug: Property 'name' does not exist on type 'Container'. #10571

GuillaumeCLProdigy opened this issue May 22, 2024 · 2 comments
Labels

Comments

@GuillaumeCLProdigy
Copy link

GuillaumeCLProdigy commented May 22, 2024

Current Behavior

When building the library I'm working on, while trying to attempt to upgrade from Pixi 6 to Pixi 7, I'm getting an error that containers don't have the name property like they should. Note that there is no packaging, this is just running a tsc over the files like so: node node_modules/typescript/bin/tsc --importHelpers.

src/renderers/components/SlicedGraphic.ts:214:28 - error TS2339: Property 'name' does not exist on type 'Container'.

214         this.elementsGroup.name = `${this.GameObject.name} - Slices`;

I didn't have a package-lock.json, but added one and verified that everything says 7.2.4 in there for Pixi things. I have also verified that the node_modules/pixi.js/lib/index.d.ts file includes the correct mixin.

Expected Behavior

Ideally this would build without error.

Steps to Reproduce

I'm currently working on making a small repro repo, but don't have one quite yet.

Environment

  • pixi.js version: 7.2.4
  • Browser & Version: Chrome 124
  • OS & Version: MacOS 14.4
  • NPM: 6.14.5
  • Node: 14.5.0

Possible Solution

None yet

Additional Information

Here's the tsconfig.json file:

{
  "extends": "./tsconfig.common.json",
  "compilerOptions": {
    "outDir": "lib",
    "removeComments": false,
    "types": ["node", "jest"],
    "declaration": true,
    "declarationDir": "dts",
    "skipLibCheck": true
  },
  "exclude": [
    "node_modules",
    "ext"
  ],
  "include": [
    "src/**/*"
  ]
}
{
  "compilerOptions": {
    "moduleResolution": "node",
    "paths": {
      "mini-signals": [
        "node_modules/resource-loader/typings/mini-signals.d.ts"
      ]
    },
    "baseUrl": "./",
    "target": "es5",
    "module": "es2015",
    "sourceMap": true,
    "lib": [ "es6", "dom" ],
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "importHelpers": true,
    "downlevelIteration": true,
    "typeRoots": [
      "node_modules/@types"
    ]
  },
  "files": [
    "./node_modules/pixi.js/lib/index.d.ts",
    "./node_modules/@pixi/sound/lib/index.d.ts",
    "./node_modules/@pixi-spine/all-4.0/index.d.ts",
    "./node_modules/reflect-metadata/index.d.ts",
    "./typings/Globals.d.ts"
  ]
}

And here's the relevant package.json file

{
  "name": "@gclp/game-framework",
  "author": "GuillaumeCLP",
  "main": "./lib/index.js",
  "types": "./dts/index.d.ts",
  "version": "12.0.0",
  "scripts": {
    "build": "node node_modules/typescript/bin/tsc --importHelpers",
    "clean": "rm -r lib && rm -r dts",
    "coverage": "npm run coverage:all",
    "coverage:all": "jest --config ./jest.config.js --coverage --maxWorkers=2 --collectCoverageFrom=src/**/*.ts --collectCoverageFrom=!src/**/index.ts",
    "coverage:files": "jest --config ./jest.config.js --coverage --maxWorkers=2 --testPathPattern ",
    "docs": "typedoc --options typedoc.json --name \"Game Framework $npm_package_version\"",
    "lint": "eslint --cache --cache-location .eslintcache --cache-strategy content -c .eslintrc.json ./src/",
    "lint:errors": "eslint --cache --cache-location .eslintcache --cache-strategy content -c .eslintrc.json ./src/ --quiet",
    "lint:fix": "eslint --cache --cache-location .eslintcache --cache-strategy content -c .eslintrc.json ./src/ --fix ",
    "lint:tests": "eslint --cache --cache-location ./test/.eslintcache --cache-strategy content -c ./test/.eslintrc.json ./test/",
    "lint:tests:errors": "eslint --cache --cache-location ./test/.eslintcache --cache-strategy content -c ./test/.eslintrc.json ./test/ --quiet",
    "lint:tests:fix": "eslint --cache --cache-location ./test/.eslintcache --cache-strategy content -c ./test/.eslintrc.json ./test/ --fix ",
    "serve": "rm -f http.log && http-server -a localhost -p 8082 > http.log 2>&1 &",
    "test": "npm run test:all",
    "test:all": "jest --config ./jest.config.js --maxWorkers=2",
    "test:files": "jest --config ./jest.config.js --maxWorkers=2 --testPathPattern ",
    "test:watch": "jest --config ./jest.config.js --maxWorkers=2 --watch",
    "test:debug": "node --inspect-brk=12769 node_modules/.bin/jest --runInBand --config ./jest.config.js"
  },
  "dependencies": {
    "@pixi-spine/all-4.0": "3.0.13",
    "@pixi/filter-multi-color-replace": "5.1.1",
    "@pixi/sound": "5.2.3",
    "@pixi/mixin-get-child-by-name": "7.4.2",
    "bowser": "2.10.0",
    "comlink": "4.1.0",
    "gsap": "3.2.6",
    "htmljs-parser": "2.9.2",
    "inversify": "4.5.2",
    "javascript-astar": "0.4.1",
    "jwt-client": "0.2.1",
    "lodash": "4.17.21",
    "pixi.js": "7.4.2",
    "polygon-clipping": "0.15.3",
    "protobufjs": "6.11.4",
    "query-string": "5.0.0",
    "socket.io": "4.5.1",
    "socket.io-client": "4.5.1",
    "tslib": "2.6.2"
  },
  "devDependencies": {
    "@prodigy/eslint-plugin-game": "1.1.1",
    "@types/jest": "25.2.1",
    "@types/lodash": "4.14.191",
    "@types/node": "13.11.1",
    "@types/socket.io": "1.4.31",
    "@types/socket.io-client": "1.4.32",
    "chalk": "4.0.0",
    "coffee-script": "1.12.7",
    "es6-shim": "0.35.3",
    "glob": "7.1.2",
    "http-server": "0.11.1",
    "husky": "4.3.8",
    "jest": "25.3.0",
    "jest-fetch-mock": "2.1.2",
    "jest-webgl-canvas-mock": "0.2.3",
    "minimist": "1.2.7",
    "reflect-metadata": "0.2.2",
    "request": "2.88.0",
    "shelljs": "0.8.5",
    "ts-jest": "25.5.1",
    "ts-loader": "5.3.3",
    "typedoc": "0.14.2",
    "typedoc-plugin-external-module-map": "1.0.0",
    "typescript": "5.3.3"
  },
  "files": [
    "lib",
    "dts"
  ]
}
@Zyie Zyie added the v7 label May 23, 2024
@delasource
Copy link

the name property is renamed in v8 to "label". can you check if you maybe have a "label" property?

if you didn't had a package-lock.json, you should not create one manually. i understood that you create one manually? (if using bun, then the file is not present, which is ok). Usually the file is automatically created with npm i

@GuillaumeCLProdigy
Copy link
Author

Doesn't look like I've got a label property either. What I meant for the package-lock.json is that it's disabled for the repo in my .npmrc and I could re-enable it to create one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants