elsassph / haxe-modular

Haxe-JS code splitting, NPM dependencies bundling, hot-reload
116 stars 14 forks source link

Error when HXML targets a directory that does not exist #40

Open jgranick opened 6 years ago

jgranick commented 6 years ago

I was going to report this on haxe-loader, but based on the stack trace, I think it occurs from haxe-modular:

webpack: wait until bundle finished: /
Parsed in: 60ms
Stats: 47 types, 25 references
Graph processed in: 8ms
Bundling...
Extract common chunks...
Moved 0 common chunks (0 shared)
fs.js:948
  binding.stat(pathModule._makeLong(path));
          ^

Error: ENOENT: no such file or directory, stat 'C:\Development\JS\openfl-js\samples\haxe\DisplayingABitmap\tmp'
    at Object.fs.statSync (fs.js:948:11)
    at Object.Main.run.$hx_exports.run (C:\Development\JS\openfl-js\samples\haxe\DisplayingABitmap\node_modules\haxe-modular\tool\bin\split.js:734:17)
    at processOutput (C:\Development\JS\openfl-js\samples\haxe\DisplayingABitmap\node_modules\haxe-loader\index.js:75:27)
    at exec (C:\Development\JS\openfl-js\samples\haxe\DisplayingABitmap\node_modules\haxe-loader\index.js:53:27)
    at ChildProcess.exithandler (child_process.js:267:7)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

...changing the HXML to target a directory that has already been created works great, so perhaps there is a way to create the output directory if it does not exist (similar to the Haxe compiler)?

Thanks :grin:

elsassph commented 6 years ago

Is it the -js output?

elsassph commented 6 years ago

That should be fixed in 0.10.2

kLabz commented 4 years ago

This happens for Reporter too

Error: ENOENT: no such file or directory, open '.build/index.js.stats.json'
    at Object.openSync (fs.js:440:3)
    at Object.writeFileSync (fs.js:1281:35)
    at Reporter.save (.../node_modules/haxe-modular/tool/bin/split.js:1606:14)
elsassph commented 4 years ago

Ugh I thought I had fixed that.