danielgtaylor / atom-api-blueprint-preview

Live preview API Blueprint in Atom
MIT License
43 stars 19 forks source link

Uncaught Error: ENOENT, no such file or directory 'C:\tmp\atom.apib' #17

Open fresch opened 9 years ago

fresch commented 9 years ago

[Enter steps to reproduce below:]

  1. install atom
  2. npm install -g aglio
  3. apm install api-blueprint-preview
  4. start atom
  5. ctrl+shif+a / packages -> api blueprint -> toggle preview

System: Win 7 pro 64bit nodejs 0.10.36 x86 npm 2.6.0 Visual Studio 2010 Express Windows SDK for Windows 7 (7.1) Visual C++ Redistributable (x86) – 10.0.30139 atom 0.182.0 20.2.2015 18:52:34

Atom Version: 0.182.0 Thrown From: api-blueprint-preview package, v0.3.0

Stack Trace

Uncaught Error: ENOENT, no such file or directory 'C:\tmp\atom.apib'

At C:\Users\asdf\AppData\Local\atom\app-0.182.0\resources\app\node_modules\q\q.js:128

Error: ENOENT, no such file or directory 'C:\tmp\atom.apib'
    at Error (native)
    at Object.fs.openSync (fs.js:503:18)
    at Object.module.(anonymous function) [as openSync] (C:\Users\asdf\AppData\Local\atom\app-0.182.0\resources\atom\common\lib\asar.js:422:20)
    at Object.fs.writeFileSync (fs.js:1116:15)
    at ApiBlueprintPreviewView.module.exports.ApiBlueprintPreviewView.renderApiBlueprintText (C:\Users\asdf\.atom\packages\api-blueprint-preview\lib\api-blueprint-preview-view.coffee:149:10)
    at ApiBlueprintPreviewView.module.exports.ApiBlueprintPreviewView.renderApiBlueprint (C:\Users\asdf\.atom\packages\api-blueprint-preview\lib\api-blueprint-preview-view.coffee:143:21)
    at C:\Users\asdf\.atom\packages\api-blueprint-preview\lib\api-blueprint-preview.coffee:63:35
    at _fulfilled (C:\Users\asdf\AppData\Local\atom\app-0.182.0\resources\app\node_modules\q\q.js:794:54)
    at self.promiseDispatch.done (C:\Users\asdf\AppData\Local\atom\app-0.182.0\resources\app\node_modules\q\q.js:823:30)
    at Promise.promise.promiseDispatch (C:\Users\asdf\AppData\Local\atom\app-0.182.0\resources\app\node_modules\q\q.js:756:13)

Commands

     -0:13.2 api-blueprint-preview:toggle (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
api-blueprint-preview, v0.3.0

# Dev
No dev packages
iiiba commented 9 years ago

workaround: just create an empty c:\tmp folder

danielgtaylor commented 9 years ago

This should be fixable by doing a check to see if the directory exists, and if not then creating it. Pull requests welcome, otherwise I'll get the fix in when I can.

thedrow commented 8 years ago

I'm seeing this on Mac OSX as well.

mansona commented 8 years ago

I'm seeing this on Mac OSX too, It seems to work the first time but then it stop working. I had a look and it seems like /tmp/atom.apib gets deleted. If I touch /tmp/atom.apib it works once more and then it breaks next time I change the source file.

I would imagine this is a race condition so https://github.com/danielgtaylor/atom-api-blueprint-preview/pull/55 should probably fix this

maurobender commented 8 years ago

I can confirm this on Mac OSX too. It switches between preview and error every time I change the file and it's really annoying.

Rambou commented 7 years ago

I confirm the same error on Ubuntu 16.04

Previewing ApiBlueprint Failed

Command failed: aglio -i /tmp/atom.apib -t /home/rambou/.atom/packages/api-blueprint-preview/templates/api-blueprint-preview.jade -n /home/rambou/Documents/api-folder -o - fs.js:640 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/home/rambou/Documents/api-folder/example-include.md' at Error (native) at Object.fs.openSync (fs.js:640:18) at Object.fs.readFileSync (fs.js:508:33) at includeReplace (/usr/lib/node_modules/aglio/lib/main.js:38:16) at RegExp.Symbol.replace at RegExp.Symbol.replace at String.replace (native) at includeDirective (/usr/lib/node_modules/aglio/lib/main.js:44:18) at Object.exports.render (/usr/lib/node_modules/aglio/lib/main.js:96:13) at render (/usr/lib/node_modules/aglio/lib/main.js:147:22)

after adding example-include.md to folder it leads to that which probably it's a Aglio-NodeJS error and has nothing to do with this plugin.

Command failed: aglio -i /tmp/atom.apib -t /home/rambou/.atom/packages/api-blueprint-preview/templates/api-blueprint-preview.jade -n /home/rambou/Documents/api-folder -o - fs.js:150 fs.Stats = function( ^ RangeError: Maximum call stack size exceeded at new fs.Stats (fs.js:150:20) at Object.fs.fstatSync (fs.js:977:18) at tryStatSync (fs.js:462:13) at Object.fs.readFileSync (fs.js:510:12) at includeReplace (/usr/lib/node_modules/aglio/lib/main.js:38:16) at RegExp.Symbol.replace at RegExp.Symbol.replace at String.replace (native) at includeDirective (/usr/lib/node_modules/aglio/lib/main.js:44:18) at includeReplace (/usr/lib/node_modules/aglio/lib/main.js:40:12)

Anyway adding example-include.md to the path folder of building fixed the problem. But this shouldn't probably happen.