-
Notifications
You must be signed in to change notification settings - Fork 4
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
ReferenceError: Worker is not defined #15
Comments
I'm also having this issue. |
I am seeing this too Reproduction code:
|
@bigtimebuddy Will this be available when pixi does another release? I tried to update the webworker-plugin directly, but was unable to get around the Worker issue. |
Yeah, I'm trying to get 7.4.1 out this week. Hang tight should be resolved soon. |
@bigtimebuddy Ah, you're awesome - thank you again! |
@bigtimebuddy Wanted to check in on the status, I saw pixijs/pixijs#10254 is awaiting a review. Are we still waiting on a PIXI release? |
@notchris bump 👍 |
@shanealsingh TY for the bump, I think this got resolved in the newest release, right @bigtimebuddy ? |
@notchris Did you try? Just tried it out n got:
:( |
I just published pixi.js@7.4.2. Can you try that version which has the fix for this Worker issue |
@bigtimebuddy I wonder if i'm doing something wrong.
I have a simple test file:
Still seeing the same issue :( |
Yeah, this is a publishing problem with dist-tags. Working on fixing now. |
I verified that this is fixed. Here's the hello-world setup: {
"name": "pixi-node-test",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@pixi/node": "^7.3.0"
}
} import { Application, Assets, Sprite } from '@pixi/node';
import path from 'path';
import { writeFileSync } from 'fs';
// This package requires the new asset loader to be used.
// Initialize the new assets loader
await Assets.init();
// The application will create a renderer using WebGL. It will also setup the ticker
// and the root stage Container.
const app = new Application();
// load a sprite
const bunnyTexture = await Assets.load(path.join(process.cwd(), 'bunny.png'));
// create sprite from texture
const bunny = Sprite.from(bunnyTexture);
// Setup the position of the bunny
bunny.x = app.renderer.width / 2;
bunny.y = app.renderer.height / 2;
// Rotate around the center
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
// Add the bunny to the scene we are building.
app.stage.addChild(bunny);
// Listen for frame updates
app.ticker.add(() => {
// each frame we spin the bunny around a bit
bunny.rotation += 0.01;
});
// extract and save the stage
app.renderer.render(app.stage);
const base64Image = app.renderer.view.toDataURL('image/png');
const base64Data = base64Image.replace(/^data:image\/png;base64,/, '');
const output = `./test.png`;
writeFileSync(output, base64Data, 'base64');
process.exit(0); |
@bigtimebuddy I did a quick test in my repo. Looks good. I don't see the |
System: Macbook, Apple M2 Pro, MacOS Ventura
Issue: When creating a new Application class, I get the following error:
"@pixi/node": "^7.3.0",
The text was updated successfully, but these errors were encountered: