mattgoldspink / grunt-sencha-dependencies

Grunt task to get the list of Ext.require dependencies in your application
MIT License
32 stars 22 forks source link

Does not work on windows #28

Closed cburgdorf closed 11 years ago

cburgdorf commented 11 years ago

I need to test that more deeply but it seems it screwed up the sencha path there. Even so the exact same configuration works fine on Mac.

cburgdorf commented 11 years ago

@nickjanssen can help testing

mattgoldspink commented 11 years ago

I'll try give it a whirl on an old xp box later today. I suspect I've stupidly hardcoded some slashes in there instead of using the path a pi to get the right platform ones.

nickjanssen commented 11 years ago

Hi Matt! If it helps, this is the error I get:

Running "sencha_dependencies:app" (sencha_dependencies) task
Processing Sencha app file index.html...
Fatal error: ENOENT, no such file or directory 'C:\C:\xampp\htdocs\frontend\sencha'

I suspect it's a bug with using absolute paths on Windows, as it seems to add drive letters twice (had the same problem in another project) but I'm not entirely sure. It's strange though as the config for sencha_dependencies has a relative path set. Perhaps you are building an absolute path somewhere internally? It's hard for me to debug, but I will take a look on my ubuntu box later.

Settings used:

   sencha_dependencies: {
      app: {
          options : {
              appFile: 'app.js',
              senchaDir: '../sencha',
              pageRoot: 'app1default',
              pageToProcess: 'index.html'
          }
      }
    },
mattgoldspink commented 11 years ago

Thanks Nick - that does help.

I've started going through the code this morning to remove all the hardcoded path seperators to using the path.sep API. This at least shows the first place in the code where it falls down. I'll try get the other places tested and fixed over the next few days, though my time is a little limited at the moment, so may take a while longer.

On Thu, Apr 25, 2013 at 10:31 AM, Nick Janssen notifications@github.comwrote:

Hi Matt! If it helps, this is the error I get:

Running "sencha_dependencies:app" (sencha_dependencies) task Processing Sencha app file index.html... Fatal error: ENOENT, no such file or directory 'C:\C:\xampp\htdocs\frontend\sencha'

I suspect it's a bug with using absolute paths on Windows, as it seems to add drive letters twice (had the same problem in another project) but I'm not entirely sure. It's strange though as the config for sencha_dependencies has a relative path set. Perhaps you are building an absolute path somewhere internally? It's hard for me to debug, but I will take a look on my ubuntu box later.

Settings used:

sencha_dependencies: { app: { options : { appFile: 'app.js', senchaDir: '../sencha', pageRoot: 'app1default', pageToProcess: 'index.html' } } },

— Reply to this email directly or view it on GitHubhttps://github.com/mattgoldspink/grunt-sencha-dependencies/issues/28#issuecomment-16996924 .

nickjanssen commented 11 years ago

Hey Matt, just an update! I finally got around to working a bit more on the windows issue. I tried your commit but it didn't work for me at all, stopping at the node.js includes:



> > Error: Cannot find module '.\lib\splitArrayIntoThree.js'```

To get around it I (ironically) just removed the `path.sep` 

Then I tried to solve it myself, with [limited success](https://github.com/nickjanssen/grunt-sencha-dependencies/commit/407c2f539d8c03033ea355811d58e7735051be10). I can get a compiled build, but the sencha dependencies are all messed up:

`Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/frontend/dest/app1default/src/event/ListenerStack.js?_dc=1368453502711
Uncaught Error: [Ext.Loader] Failed loading 'http://localhost/frontend/dest/app1default/src/event/ListenerStack.js', please verify that the file exists sencha-custom.min.js:2
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/frontend/dest/app1default/src/event/Dom.js?_dc=1368453502711
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/frontend/dest/app1default/src/event/Event.js?_dc=1368453502712
Failed to load resource: the server responded with a status of 404 (Not Found)`

Sigh...had enough for today. 
mattgoldspink commented 11 years ago

@nickjanssen Apologies it's taken so long to look into this. I have it now fixed. I've tested it with the grunt-ext-example project I have and it seems to work fine for me. If you can pull down 0.7.1 from NPM and give it a try let me know how you get on.

nickjanssen commented 11 years ago

Thanks Matt! Seems to work fine here now, great work!