yordan-kanchelov / pixi-typescript-boilerplate

Template for PixiJS using Typescript and Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with npm run build

alamboley opened this issue · comments

Hello,

Did npm install and then npm run dev work fine : Server running at http://localhost:8080 .

Then I tried npm run build and got:

⠧ Building settings.es.js...node_modules/pixi.js/pixi.js.d.ts:4:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: VERSION, PI_2, RAD_TO_DEG, DEG_TO_RAD, TEXT_GRADIENT, TARGET_FPMS, MIPMAP_TEXTURES, RESOLUTION, FILTER_RESOLUTION, SPRITE_MAX_TEXTURES, SPRITE_BATCH_SIZE, RETINA_PREFIX, RENDER_OPTIONS, GC_MODE, GC_MAX_IDLE, GC_MAX_CHECK_COUNT, WRAP_MODE, SCALE_MODE, PRECISION_VERTEX, PRECISION_FRAGMENT, UPLOADS_PER_FRAME, CAN_UPLOAD_SAME_BUFFER, AccessibilityManager, Bounds, Container, DisplayObject, Transform, GraphicsData, Graphics, Matrix, ObservablePoint, Point, Circle, Ellipse, Polygon, Rectangle, RoundedRectangle, ObjectRenderer, Quad, Filter, SpriteMaskFilter, Sprite, TextStyle, TextMetrics, Text, BaseRenderTexture, BaseTexture, RenderTexture, Texture, TextureMatrix, TextureUvs, Spritesheet, Shader, FXAAFilter, BlurFilter, ColorMatrixFilter, DisplacementFilter, AlphaFilter, NoiseFilter, InteractionData, InteractionPointerEvents, InteractionTouchEvents, InteractionMouseEvents, InteractionPixiEvents, InteractionEventTypes, InteractionManager, premultiplyBlendMode, TextureCache, BaseTextureCache, isMobile, EventEmitter, PIXI

4 declare namespace PIXI {
  ~~~~~~~

  ../../../../../node_modules/@types/pixi.js/index.d.ts:7:1
    7 declare namespace PIXI {
      ~~~~~~~
    Conflicts are in this file.

node_modules/pixi.js/pixi.js.d.ts:1131:10 - error TS2567: Enum declarations can only merge with namespace or other enum declarations.

1131     enum RENDERER_TYPE {
              ~~~~~~~~~~~~~

...and more...


Found 30 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pixi-typescript-boilerplate@2.3.0 type-check: `tsc --noEmit`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pixi-typescript-boilerplate@2.3.0 type-check script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aymeric/.npm/_logs/2020-04-15T11_50_13_978Z-debug.log
✨  Built in 16.37s.

dist/src.a142f48a.js.map    ⚠️  1.61 MB      92ms
dist/src.a142f48a.js         394.14 KB    13.93s
dist/index.html                  330 B     2.19s
dist/rabbit.2642334d.png         309 B     1.10s

Hi @jkanchelov also the index.html in the dist has a bad link to the script because it generates <body> <script src="/src.a142f48a.js"></script> </body> it should be <script src="./src.a142f48a.js"></script>.

Thanks for the report ! I will check it soon

Also just to mention when we put a wrong url for Sprite.from(myImageURL) we don't have any error.

And not sure if we need to add as a devDependencies "@types/pixi.js": "^5.0.0" since Pixi comes with types now?

You are right about the unneeded typings. Still I can't reproduce your issue. Added CI to build on linux mac and windows and they seem to be working fine.

I tried on my PC this weekend, no error, on my mac this morning : conflict, but I still have the final build.

On this one, in both case, I've an issue in the index.html because <script src="/Main.e588a0ee.js"> is an absolute way whereas it should be relative <script src="./Main.e588a0ee.js"> or <script src="Main.e588a0ee.js">.