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

Android crashing - compilation error #248

Open
farazirfan47 opened this issue Jun 4, 2020 · 5 comments
Open

Android crashing - compilation error #248

farazirfan47 opened this issue Jun 4, 2020 · 5 comments

Comments

@farazirfan47
Copy link

farazirfan47 commented Jun 4, 2020

BUG

library version

├── gl-react@4.0.1 
└── gl-react-expo@4.0.1

Expected behavior

Should see blue shaded view in android

Actual behavior

Always crashing and getting this error:

gl-shader: Error compiling shader:
Compile failed.
ERROR: 0:1: '' :   Invalid directive 5
1 compilation errors. No code generated.

Steps to reproduce the behavior

Anytime I run code I got compilation error, see sample code below

import React from "react";
import { Shaders, Node, GLSL } from "gl-react";
import { Surface } from "gl-react-expo"; // for React Native via Expo GLView
const shaders = Shaders.create({
  helloBlue: {
    frag: GLSL`
precision highp float;
varying vec2 uv;
uniform float blue;
void main() {
  gl_FragColor = vec4(uv.x, uv.y, blue, 1.0);
}`
  }
});

class HelloBlue extends React.Component {
  render() {
    const { blue } = this.props;
    return <Node shader={shaders.helloBlue} uniforms={{ blue }} />;
  }
}

export default class GLTest extends React.Component{
    render(){
        return(
            <Surface style={{width: 300, height: 500}}>
                <HelloBlue blue={0.5} />
            </Surface>
        )
    }
}
@gre
Copy link
Owner

gre commented Jun 4, 2020

what is the error?

@farazirfan47
Copy link
Author

@gre just updated bug info

@farazirfan47
Copy link
Author

farazirfan47 commented Jun 4, 2020

@gre here is full screenshot
Screenshot_20200604-155829

@MuZeQiu
Copy link

MuZeQiu commented Jun 6, 2020

error: Error: Unable to resolve module buffer from node_modules/typedarray-pool/pool.js: buffer could not be found within the project.

@gre
Copy link
Owner

gre commented Jun 6, 2020

I'm not exactly sure but you could try to remove the "precision highp float;" @farazirfan47

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