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

ERROR: Missing main() #23

Open
coolemur opened this issue Sep 26, 2019 · 3 comments
Open

ERROR: Missing main() #23

coolemur opened this issue Sep 26, 2019 · 3 comments

Comments

@coolemur
Copy link

Hi.

I'm getting an error:

app.js:44688 THREE.WebGLProgram: shader error:  0 35715 false gl.getProgramInfoLog invalid shaders� THREE.WebGLShader: gl.getShaderInfoLog() vertex
ERROR: Missing main()

Webpack rules:

        webpack({
          mode: "development",
          output: {
            filename: "app.js"
          },
          devtool: "source-map",
          module: {
            rules: [
              {
                test: /\.m?js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                  loader: "babel-loader",
                  options: {
                    presets: ["@babel/preset-env"]
                  }
                }
              },
              {
                test: /\.(glsl|vs|fs|vert|frag)$/,
                exclude: /node_modules/,
                use: [
                  'raw-loader',
                  'glslify-loader'
                ]
              }
            ]
          }
        })

Shader files (.frag & .vert) are valid, because when I use them inline they work as expected. And they definitely have main functions.

Any ideas what am I doing wrong ?

@coolemur
Copy link
Author

Update:

glslify(require('./particle.vert'))

Returns empty string.

require('./particle.vert') returns Module (as expected).

@pqml
Copy link
Collaborator

pqml commented Oct 2, 2019

Can you give me a complete code example ?
In webpack I don't think you have to use the glsify() function, the main goal of the loader is to do this step for you

@ramene
Copy link

ramene commented Jun 27, 2020

This issue crops up due to their merging in support for ES modules; downgrade raw-loader to release ≤ 1.0.0

Original PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants