Closed lukassemmler closed 10 months ago
Hi @lukassemmler,
I'd be happy to help. Do you mind attaching a .zip file of all this setup (minus the node_modules
directory, don't need to blow up the file size 😉) so I can make sure I have the exact same set up that's causing this issue? Thanks!
Hey @ChiefOfGxBxL,
thanks for your help! Here is the setup (without the node_modules/
directory): warcraft3-map-analyzer-install-test.zip
@lukassemmler Thanks, I am able to recreate the same issue you are seeing.
It appears that wc3maptranslator
is only building the index.js
file (from the index.ts
file in this repository), but TypeScript is not building the .js
files for all of the .ts
translator files under lib/
and lib/translators
, hence the module not found error.
I have some fixing to do on this repository to resolve why those files aren't building except the index.js
file.
In the meantime, you can perform the following hotfix for your project:
cd
into node_modules/wc3maptranslator
npm install
to install all the wc3maptranslator dependenciesnpm run build
(still under the node_modules/wc3maptranslator
directory)
.js
files for each .ts
file under lib/
and lib/translators
You should now be able to use your code. I can see that this hotfix allows me to write the camera file as expected.
@ChiefOfGxBxL Thank you for your help, the hotfix worked!
I did get a lot of warnings when running npm build
in the node_modules/wc3maptranslator
directory about module resolution, but I guess thats not a problem for now.
@ChiefOfGxBxL Same question, this is a tool maybe useful. [semantic-release] (https://github.com/semantic-release/semantic-release)
@ChiefOfGxBxL Hey man great tool, when can we expect an .exe version? the modding community would greatly appreciate it!
@Grimgrents2 Can you clarify - do you mean building a GUI so people can open maps and translate the files they want without having to write the code? Would a web-based interface also work?
Related to #69 and resolved in v4.0.4, published to npm
.
Hello 👋 sorry if this is trivial, but I could not get the v4.0.0 of this package working.
I tried multiple ways to run the example in the readme, but i'm not sure what the right setup is. I compiled the example with Typescript and then ran it with Node. Here is the error stack:
Here is my project setup:
index.ts
:package.json
:tsconfig.json
:Then I ran
tsc
to compile thesrc/index.ts
intodist/index.js
and rannode .\dist\index.js
. The before mentioned error gets thrown.The versions I used:
nvm
(nvm-windows
): v1.1.9node
: v16.13.2npm
: v8.1.2tsc
: v4.6.3I thought the problem was that my Node version is outdated and the line
const translators_1 = require("./lib/translators");
inw3maptranslator/index.js
does not get handled properly. But the readme says at least "Node >= 14" and I used Node v16.If I understand correctly, the
import
syntax of JavaScript is from ES6 and therequire
syntax from CommonJS. Besides 1) transpiling with Typescript, I also tried using 2) bundling aindex.js
file with Webpack and 3) addingtype: module
to thepackage.json
. None worked so far.Any help would be very appreciated!
Best regards, Lukas