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: Pixi 8 build with vite get warning and pixi crashes when minify is turned on #10137

Closed
aronsuarez opened this issue Jan 20, 2024 · 2 comments · Fixed by #10157
Closed

Bug: Pixi 8 build with vite get warning and pixi crashes when minify is turned on #10137

aronsuarez opened this issue Jan 20, 2024 · 2 comments · Fixed by #10157

Comments

@aronsuarez
Copy link

Current Behavior

When i build pixijs with vite and minify turned on i got this warnings:

Use of eval in "node_modules/pixi.js/lib/compressed-textures/basis/worker/BasisWorker.mjs" is strongly discouraged as it poses security risks and may cause issues with minification. Use of eval in "node_modules/pixi.js/lib/compressed-textures/ktx/worker/KTXWorker.mjs" is strongly discouraged as it poses security risks and may cause issues with minification. Use of eval in "node_modules/@protobufjs/inquire/index.js" is strongly discouraged as it poses security risks and may cause issues with minification.

Deployed, pixi crashes after launching, if a turn off minify in the vite build config, it works as espected

Expected Behavior

Build the code with minify on and running as expected

Steps to Reproduce

Setup a vue3 project with vite and integrate pixi js, then build it with and without minify

Environment

  • pixi.js version: 8.0.0-rc4
  • Browser & Version: Chrome 120
  • OS & Version: MacOS 14.1

Possible Solution

No response

Additional Information

No response

@norflin321
Copy link

adding import "pixi.js/unsafe-eval"; should fix the issue

@Zyie Zyie linked a pull request Jan 26, 2024 that will close this issue
@Zyie Zyie closed this as completed Jan 26, 2024
@aronsuarez
Copy link
Author

@norflin321 it works, thank you!

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

Successfully merging a pull request may close this issue.

3 participants