-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Uncaught TypeError: fs.readFileSync is not a function in mapbox index.js #23
Comments
Can you post your platform, Node version etc? |
node v4.6.0 |
I can only test on Windows Server 2012 R2 (x64) via continous integration. Do the following commands work?
I guess it's a build issue of Mapbox GL. But supporting everything on Windows is a bit difficult - that's why I will provide it as downloadable exe in the end. |
I meet the same problem.
it seems that node.js code has been bundled in the browser's javascript file |
With the newest Mapbox GL package this should be solved now. |
var fs = require('fs');
var path = require('path');
// readFileSync calls must be written out long-form for brfs.
module.exports = {
debug: {
fragmentSource: fs.readFileSync(path.join(__dirname, 'src/debug.fragment.glsl'), 'utf8'), //Uncaught TypeError: fs.readFileSync is not a function
vertexSource: fs.readFileSync(path.join(__dirname, 'src/debug.vertex.glsl'), 'utf8')
},
The text was updated successfully, but these errors were encountered: