Ember not generating model files - ember.js

Trying to use the cli to generate model files but no files get generated.
I run:
ember generate model blurbs
and it returns these two lines without any mention of actual files being generated (like app/models/blurbs.js)
installing model
installing model-test
I was able to generate my routes (ember g route blurb) correctly before but for models it lists no files and none are generated either.
This is my setup:
ember-cli: 3.11.0
ember-data: 3.11.2
node: 12.6.0
os: win32 x64

This is a known issue in Ember 3.11.x:
You can read about it here: https://blog.emberjs.com/2019/07/15/ember-3-11-released.html (Search for "Important Note")
For now, I recommend downgrading to Ember Data 3.10.
The bug has been fixed here, and should be in a future version of Ember Data, but the fix has not been backported to 3.11.
Update: Fixed in Ember Data 3.11.4

Related

ember.js ember generate acceptance-test does not generate a test file

I am trying to learn ember by following the tutorial that they have on their website.
One of the section was about generating a test file by running ember generate acceptance-test super-rentals which is supposed to generate a file under tests/acceptance/ and show this in the terminal
$ ember generate acceptance-test super-rentals
installing acceptance-test
create tests/acceptance/super-rentals-test.js
However, when I run the command it only shows:
% ember g acceptance-test super-rentals
installing acceptance-test
And it does not create any files under the tests folder.
I can't seem to find anything relate to this on stack overflow.
Does anyone know why this is not working?
there was a regression in ember 4.4 recently -- the fix hasn't been released yet, so you'll need to downgrade ember-source to ~4.3.0
Here is the reported issue(s):
https://github.com/emberjs/ember.js/issues/20081
https://github.com/emberjs/ember.js/issues/20088
And the fixing PR: https://github.com/emberjs/ember.js/pull/20082

error when building newly initialized addon

After I had troubles building/serving an addon I'm working at, I did the usual steps to heal (delete node_modules, npm clean, npm install, ...) with no success.
So finally I'm at the stage where I newly created a fresh addon via ember addon jeff-table to port the 'old' not working repo to there....
Addon-creation was successful:
installing addon
create .bowerrc
....
create .npmignore
Successfully initialized git.
Installed packages for tooling via npm.
Installed browser packages via Bower.
Anyway, again I get the same errors when trying to build the untouched addon:
Cannot read property '0' of undefined
TypeError: Cannot read property '0' of undefined
at EmberAddon.EmberApp._initVendorFiles (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\broccoli\ember-app.js:317:55)
at EmberAddon.EmberApp [as appConstructor] (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\broccoli\ember-app.js:94:8)
at new EmberAddon (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\broccoli\ember-addon.js:38:8)
at module.exports (C:\users\jefff\google drive\www\ember-addons\jeff-table\ember-cli-build.js:6:13)
at Class.module.exports.Task.extend.setupBroccoliBuilder (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\models\builder.js:55:
19)
at Class.module.exports.Task.extend.init (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\models\builder.js:89:10)
at new Class (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\node_modules\core-object\core-object.js:18:12)
at Class.module.exports.Task.extend.run (C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\tasks\serve.js:15:19)
at C:\users\jefff\google drive\www\ember-addons\jeff-table\node_modules\ember-cli\lib\commands\serve.js:64:24
I suspected GDrive to have messed up my node_modules or smth, but on a fresh installation this could not be the case (with GDrive switched of).
I have not touched installation of ember-cli (not that I know of).
Does anybody have an idea of what could be wrong here?
ember-cli: 2.5.0
node: 4.2.2
os: win32 x64
Try setting a lodash dependency in your package.json to a version older than 4.17.0. It's a dependency of ember-cli and was updated last night. I had the same error and stack trace with one of my company's projects this morning, it compiled last night in the CI system but failed this morning with no changes to the project. I compared the downloaded dependencies, and a couple had new versions. The first difference was lodash, so I added the 4.16.6 version to my package.json (the version that worked last night) and my project compiled again.
I'm still a novice when it comes to Node, so there may be a better solution, but this isn't the first time I was able to resolve a compilation break by forcing npm to get an older version of a dependency.
the same issue hit my projects as well.
#Bloomy you are right,
error comes from here
/node_modules/ember-cli/lib/broccoli/ember-app.js:317:55
by short debugging it appear that the issue with accessing a property from an object which isn't exist, because, as I guess, lodash 'avoid deep cloning of ._omit result' https://github.com/lodash/lodash/commit/6c427b7a260183685b16d2624351529cda25ce81 .
If you will put version of lodash in ember-cli to some version which goes before (just for your local version) - you will see it works. Not possible for production yet. Going to open a ticket in ember-cli addon if isn't opened yet :)
I was also facing the same issue and raised the following issue in github
https://github.com/ember-cli/ember-cli/issues/6432
And found out that the recent release of lodash i.e. lodash#4.17.0 has a little bug in it which is breaking things. So till a patch is released, try using lodash#4.16.5, this should solve your problem for now.

How can I get source maps to work when running tests using ember-qunit for an ember app built on ember-cli

I have an Ember app built using ember-cli and I'm writing my tests using the ember-qunit testing adapter and running them in the browser using testem as instructed in the ember-cli documentation. Although debugging in Google Chrome works fine when I'm interesting with my app, I am unable to use many debugging features such as breakpoints when running my tests.
I often run into a problem that my tests fail despite my actual app seeming to work properly, and to investigate the problem I would like to step through code while my tests are running.
But when I step into code that appears in vendor.js I just just see the following contents in my vendor.js:
// Please wait a bit.
// Compiled script is not shown while source map is being loaded!
These two lines are lines 6 & 7 of the file. The lines before this are blank, and these two lines are the last lines in the file. The debugger has the first line of the file highlighted as if that's the current location in the source, but it cannot show the source for some reason.
I can proceed to step through the code, but I can't see anything.
However, if I find vendor.js in the list of sources in the developer tools sources file list then it opens as a separate source tab and I can see all my code. At this point I have two tabs labeled vendor.js, one with all my vendor assets and one with just those line quoted above.
I am guessing that there is something different between how my tests are served and how my app is served in the development environment that is confusing Chrome.
I am using the following versions of things:
ember 1.9.1
ember-data 1.0.0-beta.14.1
ember-cli 0.1.9
qunit 1.17.1
ember-qunit 0.2.0
testem 0.6.33
Although I've poked around a bunch I don't really have any leads on where the problem is stemming from. Perhaps it's related to how testem is running the tests? Or could it be something that gets included in my tests has a messed up source map?
I appreciate any help or ideas.
I'm on ember-cli 0.2.2.
I ran across this problem as well and found this Chrome issue with processing sourcemaps.
People commenting on the issue suggest using the Chrome Canary build for now:
I'm currently using the Canary build to put breakpoints in and debug my ember code.
Get it here: https://www.google.com/chrome/browser/canary.html

Ember.js jsBin template/skeleton with the latest Ember.js code

Whatever Ember.js links I was including on jsbin is no longer working. So I would like this thread to have the latest working template/skeleton of Ember.js for jsBin.
Here is a link to jsbin with the latest Ember.js code: http://jsbin.com/ucanam/239/edit
In future you can find updated links here: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md
You could just use the Ember.js custom JS Bin at http://emberjs.jsbin.com.
Here is the JSBin with the latest EmberJS: http://jsbin.com/neham/1/edit
Where can I get the links for the latest release of Ember.js?
You can find the latest release under the 'Builds' tab in the official Ember.js website. That would be here.
Where can I get the links to the latest builds of Ember.js?
You can also find the latest beta builds under the 'Builds' tab in the official Ember.js website. That would be here.
What is the compatible version of Handlebars.js?
Ember is very specific about what version of Handlebars it requires. For this, I usually check the ember-source.gemspec file in here.
Before you check the .gemspec file, ensure that you switch to the right version of the emberjs build that you are using.

Template requires newer script versions than project contains

I try to use the breeze/angular template for MVC 4. However, during start up I get this:
Package installation error
Could not add all required packages to the project. the following packages failed to install from .../asp.net mvc 4\packages
jquery.ui.combined.1.9.2 unable to find version 1.9.2 of package.
Now I see that the folder contains jQuery.UI.Combined.1.8.24, so I was wondering:
Is there a way to edit the project so that it (maybe always) uses the latest versions of the packages by default?
Should I just press OK and afterwards install jquery.ui through nuget afterwards?
Is there a clever way to fix this?
I know there has to be a solution due to the uglyness of getting an error by default when using a custom template. I've been googling my ass off without any results :(
Hope to update the templates soon and get MS to republish. You can't update the template easily yourself.
Fortunately, this particular issue is easy to workaround by adjusting your code to use latest jQuery or rollback to 1.8.x.
I can't use the latest verison of jQuery so I manually updated the jQuery files to 1.9. Also, check your nuget manager for updates. Breeze released 1.3.6 which will update the appropriate dependent project libraries (my jQuery files were untouched).
As of Visual Studio 2012 Update 3, the Breeze/Angular SPA template is totally broken. The jQuery update fix worked with VS2012 Update 2, but some change or another in Update 3 has made VS not play nice with the sample.
It isn't ideal, but given that Update 4 is just around the corner, we might need to hold our breaths in anticipation of a post-Update 4 fix. :(