rustyscreeps / cargo-screeps

Build tool for deploying Rust WASM code to Screeps game servers
MIT License
25 stars 13 forks source link

Need update for latest wasm-pack #34

Closed ttxs25830 closed 1 year ago

ttxs25830 commented 1 year ago

Note i'm installing this by compile from git repo commit e3f30fdf0dcfc088af3aa73a32b76fff2321321e

error: 'wasm-pack' generated unexpected JS output! This means it's updated without 'cargo screeps' also having updated. Please report this issue to https://github.com/rustyscreeps/cargo-screeps/issues and include the first ~30 lines of /home/user/Projects/screeps-starter-rust/pkg/screeps-starter-rust.js
let imports = {};
let wasm;

const path = require('path').join(__dirname, 'screeps-starter-rust_bg.wasm');
const bytes = require('fs').readFileSync(path);

const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
wasm = wasmInstance.exports;
module.exports.__wasm = wasm;