BabylonJS / Extensions

Extensions for Babylon.js
178 stars 157 forks source link

MeshWriter won't load into NodeJS #178

Closed swilcox3 closed 5 years ago

swilcox3 commented 5 years ago

When I download either meshwriter.js or meshwriter.min.js and use require("./meshwriter"), I get this output:

Uncaught SyntaxError: Unexpected token < at new Script (vm.js:74) at createScript (vm.js:246) at Object.runInThisContext (vm.js:298) at Module._compile (internal/modules/cjs/loader.js:678) at Object.Module._extensions..js (internal/modules/cjs/loader.js:722) at Module.load (internal/modules/cjs/loader.js:620) at tryModuleLoad (internal/modules/cjs/loader.js:559) at Function.Module._load (internal/modules/cjs/loader.js:551) at Module.require (internal/modules/cjs/loader.js:658) at require (internal/modules/cjs/helpers.js:20)

I'm on NodeJS 10.15.3, BabylonJS 4.0.0, Typescript 3.5.3.

briantbutton commented 5 years ago

Swilcox3, I am unable to reproduce this issue. I downloaded meshwriter.min.js from this repo. It behaved as expected when I loaded using 'require'. Do you suppose there might be a problem with the file contents?

Here is a problem I have had in the past. I load a js file and the server gives me a 404 page instead (for whatever reason). That page starts with a '<', because it is html. It will cause the symptoms you describe.

If you still have this problem, then I probably need to look at the contents of the file you are trying to use.

swilcox3 commented 5 years ago

You know what, I'm an idiot. I downloaded the file with "Save Link as..." which saved the entire webpage contents. As you were, nothing to see here.