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

Pixi with SSR library like NUXT #4558

Closed
mcpll opened this issue Dec 23, 2017 · 13 comments
Closed

Pixi with SSR library like NUXT #4558

mcpll opened this issue Dec 23, 2017 · 13 comments
Labels
🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim

Comments

@mcpll
Copy link

mcpll commented Dec 23, 2017

Goodmorning everyone,
I wanted to ask if anyone tried to use pixi together with nuxt.js because there seem to be errors.

@ivanpopelyshev
Copy link
Collaborator

Server-side rendering? I dont know how is it related to pixi. Polyfills conflict?

@mcpll
Copy link
Author

mcpll commented Dec 23, 2017

it is as if at the time that I execute the import the library went immediately to look for some element of the dom.
Is it possible?

@ivanpopelyshev
Copy link
Collaborator

ah, that thing. There was huge PR to make pixi work on node.js . PIXI has some initializations that work immidiately. #4367

@Cristy94
Copy link
Contributor

I added a short tutorial a while ago about running Phaser on the server. You have there some tricks you can use to make the app think it's still running inside the browser. http://www.tips4design.com/2015/06/js-running-phaser-in-nodejs.html

@Prozi
Copy link

Prozi commented Feb 19, 2018

@mcpll
Copy link
Author

mcpll commented Feb 20, 2018

@Prozi
I try to install and execute in my nuxt project but i receive this error with fs
This dependency was not found:

  • fs in ./node_modules/canvas-prebuilt/canvas/lib/canvas.js

To install it, you can run: npm install --save fs

This relative module was not found:

  • ../build/Release/canvas in ./node_modules/canvas-prebuilt/canvas/lib/bindings.js

@ivanpopelyshev
Copy link
Collaborator

is there node_modules/canvas-prebuilt folder?

@Prozi
Copy link

Prozi commented Feb 20, 2018

then install fs by npm install fs --save

strange it should work out of the box

@mcpll
Copy link
Author

mcpll commented Feb 20, 2018

@ivanpopelyshev yes
@Prozi I've just install fs but nothing change...

what do you think?

@Prozi
Copy link

Prozi commented Feb 20, 2018

its possible you have 32 bit system?

canvas-prebuilt doesnt work with 32 bit systems AFAIK

you'd need to fork my repo and replace canvas-prebuilt dependency with canvas

along with installing canvas yourself (which is a pain in the ass especially on windows)

good luck, let us know how it went!

@Prozi
Copy link

Prozi commented Feb 20, 2018

oooooh wait you're not trying to use it on serverside right?

you're just trying to use pixi.js with nuxt.js right?

then it should work out of the box - and YOU DONT NEED THAT REPO

@themoonrat themoonrat added the 🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim label Jul 2, 2018
@themoonrat
Copy link
Member

Closing due to inactivity

@lock
Copy link

lock bot commented Jul 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim
Projects
None yet
Development

No branches or pull requests

5 participants