wasdk / WebAssemblyStudio

Learn, Teach, Work and Play in the WebAssembly Studio
http://webassembly.studio
MIT License
2.91k stars 274 forks source link

Fail to compile wasm locally #465

Open wangtz opened 3 years ago

wangtz commented 3 years ago

This site is great starting point for learning wasm. However it doesn't seem to work locally with "Download" button.

I tried gulp --require ts-node/register --gulpfile ./build.ts and got the following errors:

[08:59:33] Requiring external module ts-node/register ReferenceError: primordials is not defined at fs.js:35:5 at req_ (/usr/local/google/home/wangtz/projects/emcc/v3/node_modules/natives/index.js:143:24) at Object.req [as require] (/usr/local/google/home/wangtz/projects/emcc/v3/node_modules/natives/index.js:55:10) at Object. (/usr/local/google/home/wangtz/projects/emcc/v3/node_modules/graceful-fs/fs.js:1:37) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Module.require (internal/modules/cjs/loader.js:1026:19) at require (internal/modules/cjs/helpers.js:72:18)

Here is my tsconfig.json file (I copied it from this repo).

{ "compilerOptions": { "outDir": "./dist/", "sourceMap": true, "noImplicitAny": true, "skipLibCheck": true, // "module": "esnext", "moduleResolution": "node", "target": "esnext", "lib": ["dom", "esnext", "es2017.object"], "jsx": "react", "declaration": true, "removeComments": false }, "include": [ "./src/*/", "node_modules/monaco-editor/monaco.d.ts" ], "exclude": [ "./templates/*/" ] }

Any help will be appreciated. Thanks!

nokotan commented 3 years ago

Related issue: Gulp 3 is broken on Node 12 #2324

Upgrading Gulp to 4 and rewriting build.ts, or Downgrading Node to v10 brings me successful build in my environment.