Giter Site home page Giter Site logo

Initialize vue plugin Error about vue3-pixi HOT 9 CLOSED

hairyf avatar hairyf commented on May 18, 2024
Initialize vue plugin Error

from vue3-pixi.

Comments (9)

senritsu avatar senritsu commented on May 18, 2024 3

Heads up for others with this issue, it seems like just using

import { isCustomElement, transformAssetUrls } from "vue3-pixi/compiler" // <-- note the `/compiler` here

does the job.

from vue3-pixi.

pearlphoenix0106 avatar pearlphoenix0106 commented on May 18, 2024

similar situation

from vue3-pixi.

hairyf avatar hairyf commented on May 18, 2024

Can you provide versions such as Vue and pixi.js ? @NONAME00X

from vue3-pixi.

NONAME00X avatar NONAME00X commented on May 18, 2024

Can you provide versions such as Vue and pixi.js ? @NONAME00X
All my dependencies below

"pixi.js": "^7.4.0",
  "screenfull": "^6.0.2",
  "unplugin-auto-import": "^0.17.5",
  "unplugin-vue-components": "^0.26.0",
  "vue": "^3.3.11",
  "vue3-pixi": "^0.9.0"

from vue3-pixi.

pearlphoenix0106 avatar pearlphoenix0106 commented on May 18, 2024

@hairyf
my current versions:

vue3-pixi: ^0.9.0
pixi.js: ^7.4.0
vue: ^3.3.4
vite: ^4.4.5
node: 20.11.0

If I use vue3-pixi: 0.8.4 and pixi.js: 7.3.2, then yarn dev works fine

from vue3-pixi.

eduard-gonzalez avatar eduard-gonzalez commented on May 18, 2024

I have the same situation with Node 20.11.0 || 18.19.0

"pinia": "^2.1.4",
"pixi.js": "^7.4.0",
"vue": "^3.3.4",
"vue-router": "^4.2.4",
"vue3-pixi": "^0.9.0"

failed to load config from \vite.config.js
error when starting dev server:
ReferenceError: Worker is not defined

from vue3-pixi.

eduard-gonzalez avatar eduard-gonzalez commented on May 18, 2024

@hairyf
See that pixijs/pixijs#10170

pixi.js does not run natively in Node.js, it's browser only. If you need to run in Node.js, you can use this project: https://github.com/pixijs/node

because when you try to compile the npm run dev it does not recognize it

from vue3-pixi.

senritsu avatar senritsu commented on May 18, 2024

@hairyf This seems to be a side-effect of how the docs for vue3-pixi import the functions used for vite.config.ts. Apparently too much of pixi is imported in the vite config, vite tries to compile it in node, and it crashes.

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { isCustomElement, transformAssetUrls } from "vue3-pixi"; // <-- this right here

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement,
        },
        transformAssetUrls,
      },
    }),
  ],
});

Without that import from vue3-pixi the dev server (or build) starts, but with it, the ReferenceError appears.

from vue3-pixi.

hairyf avatar hairyf commented on May 18, 2024

@senritsu Thank, I will merge him

from vue3-pixi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.