glimmerjs / glimmer-blueprint

[MOVED] This package is now part of the Glimmer.js monorepo
https://github.com/glimmerjs/glimmer.js
25 stars 13 forks source link

Ember serve fails if the appname doesn't contain a dash #15

Closed t-sauer closed 7 years ago

t-sauer commented 7 years ago

Steps to reproduce:

  1. ember new playground -b @glimmer/blueprint
  2. cd playground
  3. ember serve

The following error shows up:

Livereload server on http://localhost:49154
Serving on http://localhost:4200/
The Broccoli Plugin: [ResolutionMapBuilder] failed with:
Error: The collection 'components' is not configured to contain a collection 'playground'
    at /Users/ts02/Code/glimmer/playground/node_modules/@glimmer/resolution-map-builder/lib/get-module-specifier.js:44:17
    at Array.forEach (native)
    at module.exports.moduleExtension (/Users/ts02/Code/glimmer/playground/node_modules/@glimmer/resolution-map-builder/lib/get-module-specifier.js:39:11)
    at /Users/ts02/Code/glimmer/playground/node_modules/@glimmer/resolution-map-builder/index.js:66:21
    at Array.forEach (native)
    at ResolutionMapBuilder.build (/Users/ts02/Code/glimmer/playground/node_modules/@glimmer/resolution-map-builder/index.js:63:15)
    at /Users/ts02/Code/glimmer/playground/node_modules/broccoli-plugin/read_compat.js:93:34
    at tryCatch (/Users/ts02/Code/glimmer/playground/node_modules/rsvp/dist/rsvp.js:539:12)
    at invokeCallback (/Users/ts02/Code/glimmer/playground/node_modules/rsvp/dist/rsvp.js:554:13)
    at publish (/Users/ts02/Code/glimmer/playground/node_modules/rsvp/dist/rsvp.js:522:7)

When I repeat the same steps as above with a dash in the name (e.g. play-ground), ember serve works fine.

mike-north commented 7 years ago

Workaround:

You'll find that there's a prepended dash for your top-level component in the src/ui/components folder. Remove this leading dash in the folder name, and in the call to app.renderComponent in src/index.js and you should be good to go.


update It seems that having a dash in component names may be mandatory. That being said, the fix I mentioned above seems to work (perhaps by happenstance).

michalsnik commented 7 years ago

It could also be fixed on blueprint level. When the app's name doesn't contain a dash, it could add -app suffix to component name and leave the rest as is. It's only a proposition though.

rwjblue commented 7 years ago

Yes, we discussed this a bit yesterday. I believe the consensus was to add -app suffix as mentioned by @michalsnik.