[v8] Cannot read property 'addRenderable' of undefined
Description
I tried using @pixi/unsafe-eval@7 and pixi.js@8, but I found it doesn't work.
Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.
Try including pixi.js/unsafe-eval. All packages are now shipped with v8.
Try including
pixi.js/unsafe-eval. All packages are now shipped with v8.
@bigtimebuddy Thank you, it's resolved.
When I run the following code in WeChat, I encounter an error.
const renderer = new PIXI.WebGLRenderer()
renderer.init({
canvas,
antialias: true,
preferWebGLVersion: 1,
backgroundColor: 0x171a24,
}).then(() => {
const g = new PIXI.Graphics()
g.fill(0xffc333)
g.rect(0, 0, 100, 100)
stage.addChild(g)
renderer.render({container: stage})
})
Cannot read property 'addRenderable' of undefined
I did some basic research and found that the error stems from the following code snippet. Additionally, I added code locally to print variable information.
https://github.com/pixijs/pixijs/blob/d4cb3d10fb8e50be8fc4e41e9d2844831df0a79e/src/scene/container/utils/buildInstructions.ts#L73-L75
console.log(rp)
console.log(container.renderPipeId)
output:
I found that there is no graphics property in rp, so rp[container.renderPipeId] is undefined.
I'm not entirely sure if this is a situation unique to WeChat.
@GoodBoyDigital
thanks for sharing! il take a look
Hey there! The issue is that the extensions are dynamically loaded when via autoDetectRenderer
the quick fix for now would be to do the following:
const renderer = await autoDetectRenderer({
preference:'webgl'
})
we will look into adding a await createWebGLRenderer() and await createWebGPURenderer() functions that install all the plugins and things!
Try including
pixi.js/unsafe-eval. All packages are now shipped with v8.
@bigtimebuddy hey, I tried to import pixi.js/unsafe-eval however, I am still getting the following error.
I am using Webpack 5 as bundler, so i have resolution config set as follows:
'pixi.js/unsafe-eval': path.resolve(__dirname, './node_modules/pixi.js/lib/unsafe-eval/init.js'),
then in the app code:
import 'pixi.js/unsafe-eval';
import { Container, Application, Ticker, Graphics } from 'pixi.js';
import * as PIXI from 'pixi.js';
also tried
import { Container, Application, Ticker, Graphics } from 'pixi.js';
import * as PIXI from 'pixi.js';
import 'pixi.js/unsafe-eval';
any clue, why it's still throwing error?
Thank you
Try including
pixi.js/unsafe-eval. All packages are now shipped with v8.@bigtimebuddy hey, I tried to import
pixi.js/unsafe-evalhowever, I am still getting the following error.I am using Webpack 5 as bundler, so i have resolution config set as follows:
'pixi.js/unsafe-eval': path.resolve(__dirname, './node_modules/pixi.js/lib/unsafe-eval/init.js'),then in the app code:
import 'pixi.js/unsafe-eval'; import { Container, Application, Ticker, Graphics } from 'pixi.js'; import * as PIXI from 'pixi.js';also tried
import { Container, Application, Ticker, Graphics } from 'pixi.js'; import * as PIXI from 'pixi.js'; import 'pixi.js/unsafe-eval';any clue, why it's still throwing error?
Thank you
apologise, please ignore my question. i did a stupid mistake.
