question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(v4) GLSLify error when using Webpack

See original GitHub issue

Running my Pixi app after bundling with Webpack results in the following error:

browser.js:2 Uncaught Error: It appears that you're using glslify in browserify without its transform applied. Make sure that you've set up glslify as a source transform

Some research suggests this is a common problem among Webpack users. https://gist.github.com/mjackson/ecd3914ebee934f4daf4#gistcomment-1842689

This solution seems to work for some people, but I still haven’t gotten it working. I’m posting an issue to see if we can come up with a common guideline for making Pixi work in a webpack app.

To reproduce the problem, simply make a webpack app with the following contents:

var PIXI = require('pixi.js');
var renderer = new PIXI.WebGLRenderer(256, 256);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
kimorkimcommented, Sep 18, 2016

@endel @xTiming Hi, guys. I found a way.

webpack.config.js

module: {
        loaders: [
            ...
            { test: path.resolve(__dirname, 'node_modules', 'pixi.js'), loader: 'ify' },
            ...
        ]
    },

The window separator is . Unlike its osx.

image

It is seen as well in the window10.

image image

2reactions
Reliccommented, Sep 9, 2016

You can reproduce this with the following:

npm install pixi.js webpack

webpack.config.js

var path = require('path');
var webpack = require('webpack');

module.exports = {
    entry: path.resolve(__dirname, 'index.js'),
    output: {
        path: path.resolve(__dirname, 'scripts/'),
        filename: 'bundle.js'
    },
    node: {
        fs: 'empty'
    }
};

index.js

var PIXI = require('pixi.js');
console.log(PIXI);
var renderer = new PIXI.WebGLRenderer(512, 512);

From the project’s root folder:

webpack --config webpack.config.js

The resulting (projectroot)/scripts/bundle.js can be accessed in a web browser and will reproduce the glslify error. Just wrote and tested it myself very quickly, if this doesn’t work let me know and I’ll try to fix it for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(v4) GLSLify error when using Webpack · Issue #2922 - GitHub
Running my Pixi app after bundling with Webpack results in the following error: browser.js:2 Uncaught Error: It appears that you're using ...
Read more >
glsify - error 'You may need an appropriate loader to handle ...
What does your webpack config files look like? Based on the error, it seems you might be missing the loaders in the module.rules...
Read more >
currently no loaders are configured to process this file - You.com
I found the problem by trial and error. The webpack.config.js wasn't happy with two separate module sections. Below is the config that resulted...
Read more >
glslify-loader - npm
glslify loader module for webpack. Latest version: 2.0.0, ... Start using glslify-loader in your project by running `npm i glslify-loader`.
Read more >
error 'You may need an appropriate loader to handle this file ...
What does your webpack config files look like? Based on the error, it seems you might be missing the loaders in the module.rules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found