Jump to content

Using pixi-viewport with old version of pixi.js


SenPie
 Share

Recommended Posts

Hi,

I want to use pixi-viewport library in my project, however I get this TypeScript errors when I try to integrate it in my project

[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(2,13): Error TS1005: '=' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 2,
  column: 13
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(2,36): Error TS1005: ';' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 2,
  column: 36
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(3,13): Error TS1005: '=' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 3,
  column: 13
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(3,38): Error TS1005: ';' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 3,
  column: 38
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(4,13): Error TS1005: '=' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 4,
  column: 13
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(4,31): Error TS1005: ';' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 4,
  column: 31
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(5,13): Error TS1005: '=' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 5,
  column: 13
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(5,39): Error TS1005: ';' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 5,
  column: 39
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(6,13): Error TS1005: '=' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 6,
  column: 13
}
[15:57:08] [TypeScript error: node_modules/pixi-viewport/index.d.ts(6,41): Error TS1005: ';' expected.] {
  fileName: 'node_modules/pixi-viewport/index.d.ts',
  line: 6,
  column: 41

I believe the issue is with me using old version of pixi.js, which is version [email protected], and [email protected]. Anyone knows which version of pixi-viewport I should use, that is compatible with old pixi? Or maybe someone knows another way to solve this issue. However, in any case I cannot upgrade my pixi version.

Link to comment
Share on other sites

Official policy is: everyone that uses v5 with typescript should upgrade to v6 because that's the main reason for upgrade - new typings with less problems.

Anyone knows which version of pixi-viewport I should use, that is compatible with old pixi?

Usually you determine it by going through commits, because, honestly, documentation is usually misleading.

Alternatively, you can just ask davidfig himself? https://github.com/davidfig/pixi-viewport/

Link to comment
Share on other sites

14 minutes ago, ivan.popelyshev said:

I dont see the problem. If you have custom typings - you can modify them

I followed your advice from previous post and fixed the typings, however there are many more other issues when compiling the code. Here is the full log: https://pastebin.com/SPUcsLcU.

Here is my tsconfig.json
and packages in package.json file

{
  "compilerOptions": {
    "target": "es6",
    "lib": ["es2015","dom"],
    "module": "commonjs",
    "typeRoots" : [ "./typings", "./node_modules/@types"],
    "noImplicitAny": false,
    "strictFunctionTypes": true,
    "alwaysStrict": true ,
	"resolveJsonModule": true,
	"esModuleInterop": true
  },
  "exclude": ["./templates"]
}
"dependencies": {
    "@pixi/utils": "^6.0.4",
    "@tweenjs/tween.js": "^17.3.0",
    "howler": "^2.1.1",
    "pixi-viewport": "^4.32.0",
    "pixi.js": "^6.0.4",
    "pixiv5-tiled": "^1.1.4"
  },
  "devDependencies": {
    "@types/howler": "^2.1.0",
    "@types/tween.js": "^17.2.0",
    "browserify": "^16.2.3",
    "del": "^3.0.0",
    "gulp": "^4.0.0",
    "gulp-concat": "^2.6.1",
    "gulp-connect": "^5.7.0",
    "gulp-inline": "^0.1.3",
    "gulp-preprocess": "^3.0.2",
    "gulp-rename": "^1.4.0",
    "gulp-sourcemaps": "^2.6.4",
    "gulp-typescript": "^5.0.0",
    "gulp-uglify-es": "^1.0.4",
    "gulp-util": "^3.0.8",
    "tsify": "^4.0.1",
    "typescript": "^3.3.3",
    "vinyl-buffer": "^1.0.1",
    "vinyl-source-stream": "^2.0.0"
  }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...