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

Uncaught TypeError: fs.readFileSync is not a function in mapbox index.js #23

Closed
coyotey opened this issue Nov 29, 2016 · 5 comments
Closed
Labels

Comments

@coyotey
Copy link

coyotey commented Nov 29, 2016

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')
},

@lukasmartinelli
Copy link
Collaborator

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')
},

Can you post your platform, Node version etc?
Node 4,5,6 and Linux, Windows, OSX are all working in continous integration.

@coyotey
Copy link
Author

coyotey commented Nov 30, 2016

node v4.6.0
Windows 10 X64

@lukasmartinelli
Copy link
Collaborator

node v4.6.0
Windows 10 X64

I can only test on Windows Server 2012 R2 (x64) via continous integration.

Do the following commands work?

md public
npm install
npm run build

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.

@topwood
Copy link

topwood commented Dec 19, 2016

I meet the same problem.

node v4.2.3
mac

it seems that node.js code has been bundled in the browser's javascript file

@lukasmartinelli
Copy link
Collaborator

With the newest Mapbox GL package this should be solved now.

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

No branches or pull requests

3 participants