Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Error: watch ENOENT #41

Closed
gadicc opened this issue Apr 16, 2016 · 11 comments
Closed

[Windows] Error: watch ENOENT #41

gadicc opened this issue Apr 16, 2016 · 11 comments
Milestone

Comments

@gadicc
Copy link
Owner

gadicc commented Apr 16, 2016

And maybe others :) Would love some help from Windows users. Otherwise will setup a Windows VM and look into this when I have a chance.

@Vincent-P
Copy link

Vincent-P commented Apr 27, 2016

I have this error by just adding your package to mantra-sample-blog-app :

=> Started proxy.
=> Started MongoDB.
   Building the application                  /
module.js:340
    throw err;
          ^
Error: Cannot find module 'undefined\dev_bundle\lib\node_modules\fibers'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at meteorRequire (C:\Users\vince\AppData\Local\.meteor\packages\gadicc_ecmascript-hot\1.3.2-refactor.6\plugin.compile-ecmascript-hot.os\npm\node_modules\meteor\gadicc_hot-build\node_modules\meteor-hotload-accelerator\lib\accelerator.js:38:10)
    at Object.<anonymous> (C:\Users\vince\AppData\Local\.meteor\packages\gadicc_ecmascript-hot\1.3.2-refactor.6\plugin.compile-ecmascript-hot.os\npm\node_modules\meteor\gadicc_hot-build\node_modules\meteor-hotload-accelerator\lib\accelerator.js:41:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
   Building the application                  -
[gadicc:hot-build] (nZ2): Unhandled websocket err! { [Error: connect ECONNREFUSED]
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect' }
=> Errors prevented startup:

   While loading plugin `compile-ecmascript-hot` from package `gadicc:ecmascript-hot`:
   fs.js:439:18: ENOENT, no such file or directory 'C:\Users\vince\.meteor\packages\gadicc_ecmascript-hot\1.3.2-refactor.6\isopack.json'
   at Object.fs.openSync (fs.js:439:18)
   at Object.fs.readFileSync (fs.js:290:15)
   at getPluginPath (packages/gadicc_hot-build/hot-server.js:85:1)
   at new Hot (packages/gadicc_hot-build/hot-server.js:109:1)
   at Package (packages/compile-ecmascript-hot/plugin.js:4:1)
   at <runJavaScript-47>:58:4
   at <runJavaScript-47>:65:3


=> Your application has errors. Waiting for file change.

I'm using

gadicc:babel-compiler-hot@6.6.2-babelrc.1
gadicc:ecmascript-hot@1.3.2-refactor.6
gadicc:hot@0.0.21
gadicc:hot-build@0.0.8
gadicc:modules-runtime-hot@0.6.3_4

@Vincent-P
Copy link

It seems like this is undefined :

// meteor-hmr/accelerator/src/accelerator.js:15

const meteorToolPath = process.argv[4];

@gadicc
Copy link
Owner Author

gadicc commented Apr 27, 2016

@Vincent-P I'll address this in #56.

@Vincent-P
Copy link

Vincent-P commented Apr 28, 2016

The issue is with toDosPath function in hot-build/hot-server.js.

@Vincent-P
Copy link

There :

Hot.prototype.processFilesForTarget = function(inputFiles) {
...
      file = convertToOSPath(path.join(
        inputFile._resourceSlot.packageSourceBatch.sourceRoot,
        inputFile.getPathInPackage()
      ));
 ...
}

In Windows I have this :

// /E/Code/WEB/mantra-sample-blog-app
inputFile._resourceSlot.packageSourceBatch.sourceRoot

// lib/collections.js
inputFile.getPathInPackage()

// \E\Code\WEB\mantra-sample-blog-app\lib\collections.js
path.join(inputFile._resourceSlot.packageSourceBatch.sourceRoot, inputFile.getPathInPackage())

or
///E/Code/WEB/mantra-sample-blog-app/lib/collections.js
inputFile._resourceSlot.packageSourceBatch.sourceRoot + '/' + inputFile.getPathInPackage()

So path.join() replaces / with \ but toDosPath expects a / :

if (p[0] === '/' && ! partialPath) {
    if (! /^\/[A-Za-z](\/|$)/.test(p))
      throw new Error("Surprising path: " + p);
    // transform a previously windows path back
    // "/C/something" to "c:/something"
    p = p[1] + ":" + p.slice(2);
  }

So replacing path.join by a string concatenation works,

file = convertToOSPath(path.join(
    inputFile._resourceSlot.packageSourceBatch.sourceRoot,
    inputFile.getPathInPackage()
));

// to
file = convertToOSPath(inputFile._resourceSlot.packageSourceBatch.sourceRoot + '/' + inputFile.getPathInPackage());

@gadicc
Copy link
Owner Author

gadicc commented Apr 28, 2016

oh wow, amazingly helpful! thanks!!

@Vincent-P
Copy link

Vincent-P commented Apr 28, 2016

So now it seems to work on Windows, the app can start but I still have no idea on how to use this with Mantra.

I have replaced ecmascript, installed react-hot-loader and redbox-react, add "react-hot-loader/babel" to .babelrc but I dont know where I have to add the AppContainer...

@gadicc gadicc closed this as completed in 2a37fa3 Apr 28, 2016
@gadicc
Copy link
Owner Author

gadicc commented Apr 28, 2016

Mmm let me actually make a quick repo of mantra-sample-blog-app, I think a lot of people would benefit from it.

@gadicc
Copy link
Owner Author

gadicc commented Apr 28, 2016

Sorry I said quickly but I ran out of time and will only get to this tomorrow. I guess you'd put the AppContainer where you have the mount commands, possibly multiple times for each route action, I haven't actually looked yet how RHLv3 plays with mantra, but if you don't get it working I'll have a repo up tomorrow (I'm in GMT+2).

@Vincent-P
Copy link

Okay I'll try thank you.

@gadicc
Copy link
Owner Author

gadicc commented Apr 29, 2016

@Vincent-P, check out #60.

Unfortunately it's not so neat... the Mantra design isn't so compatible with react-hot-loader. Maybe we can find a compromise in the future.

@gadicc gadicc added this to the v2 milestone May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants