j-mcnally / ember-cli-chrome

A small and growing toolkit to build chrome extensions with EmberJS
62 stars 12 forks source link

ember-cli 0.0.40: DEPRECATION: ember-cli-chrome is using the deprecated ember-addon-main definition #1

Closed tute closed 9 years ago

tute commented 10 years ago

When I try to use your library in an ember-cli v0.0.40, I get:

DEPRECATION: ember-cli-chrome is using the deprecated ember-addon-main definition. It should be updated to {'ember-addon': {'main': 'lib/chrome-app.js'}}

This renders a GET http://localhost:4200/ember-chrome.js 404 (Not Found) error, failing the Ember app to boot. If I downgrade ember-cli to 0.0.37 it works well.

Thank you for your work!

jyriand commented 10 years ago

I'm stuck on this as well. Seems like it's not as simple as going to node_modules/ember-cli-chrome and modifing ember-addon line in package.json. Have to use 0.0.37 meanwhile.

superlou commented 9 years ago

I'm running into a similar issue. When I try ember server, I get:

version: 0.0.44
DEPRECATION: ember-cli-chrome is using the deprecated ember-addon-main definition. It should be updated to {'ember-addon': {'main': 'lib/chrome-app.js'}}
DEPRECATION: ember-cli-chrome is using the deprecated ember-addon-main definition. It should be updated to {'ember-addon': {'main': 'lib/chrome-app.js'}}
DEPRECATION: ember-cli-chrome is using the deprecated ember-addon-main definition. It should be updated to {'ember-addon': {'main': 'lib/chrome-app.js'}}
Livereload server on port 35729
Serving on http://0.0.0.0:4200
watch ENOSPC
Error: watch ENOSPC
  at errnoException (fs.js:1030:11)
  at FSWatcher.start (fs.js:1062:11)
  at Object.fs.watch (fs.js:1087:11)
  at Watcher.watchdir (/home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/index.js:187:20)
  at new Watcher (/home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/index.js:66:10)
  at EventEmitter.Watcher_addWatchDir [as addWatchDir] (/home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/index.js:69:17)
  at /home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/broccoli/lib/builder.js:66:35
  at $$$internal$$tryCatch (/home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:470:16)
  at $$$internal$$invokeCallback (/home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:482:17)
  at /home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1066:13
  at $$rsvp$asap$$flush (/home/lsimons/workspace/scriptdrive/app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1531:9)
  at process._tickCallback (node.js:419:13)

I can resolve the DEPRECATION warnings by changing ember-cli-chrome/package.json as indicated in the warning, but still receive all of the other errors.

Nothing seems to be served in the browser.

j-mcnally commented 9 years ago

Yikes, sorry guys ill look into this ASAP! I totally missed this issue.

j-mcnally commented 9 years ago

@superlou: ENOSPC means your drive is full i think.

superlou commented 9 years ago

@j-mcnally: Looks like it's related to a limit on the number of watches allowed. That fix worked. Now I'm back to the symptoms @tute was having with the 404 on ember-chrome.js.

j-mcnally commented 9 years ago

gotcha, if you give me the weekend ill release a new version, to fix this. it has to do with the way the public tree get injected, there is a new way its just not implemented yet.

j-mcnally commented 9 years ago

If you want to take a whack at it on your own, it should probably look more like this,

https://github.com/j-mcnally/ember-cli-standalone/blob/master/lib/standalone.js#L114

However both of these packages need to be updated for 0.1.x which changes alot about how this stuff works. In 0.1.x we will need to tell the env.js / ember-chrome.js files to inject a meta tag like this:

    metaTag = document.createElement('meta')
    metaTag.name = "myapp/config/environment"
    metaTag.content = escape(JSON.stringify(window.MyAppENV))
    document.getElementsByTagName('head')[0].appendChild(metaTag)
superlou commented 9 years ago

Thanks! Will look into it, and defer to your patch when I give up. Mostly wanted to make sure there wasn't some fundamental change that would make developing Chrome+Ember apps not feasible.

The whole EmberCLIChrome.prototype.included needs to be modified to be like standalone's, or just the highlighted line?

j-mcnally commented 9 years ago

probably the whole included. Sorry im behind on this, we havent upgraded our Chrome extension to the latest CLI yet. Also i think ember-cli allows you to add your own custom trees now, so i may have a whack at doing that rather than hijacking the index tree, should be more future proof.

j-mcnally commented 9 years ago

Ok, so i believe i just pushed a fix for this on Ember-CLI 0.1.x if you want to check out what was involved see http://struct.tv/streams/15 once it finishes transcoding.