Migrating App Kit to Ember CLI - ReferenceError window is not defined - ember.js

After discovering that Ember App Kit along with useage of Grunt are depricated now, I installed Ember CLI and tried to migrate a fresh copy of the App Kit to Ember CLI by running 'ember init', but I got this error 'ReferenceError: window is not defined at Object.'. I also ran 'npm install' and 'bower install' to get dependent modules, but still 'ember init' won't run. It seems that there's a problem with 'window' in 'config\environment.js'.
Rather than migrating the old App Kit, shouldn't we have a new starter kit based on Ember CLI?

While the old EAK project site suggests that you can migrate it to CLI, I found that to be problematic. But there's no need to start with the EAK anymore since Ember CLI will scaffold up a new starter project for you.

Related

ionic cordova plugin add cordova-plugin-advanced-http already installed

I am new on Ionic Mobile application development, so I am trying to POST data from Ionic app. Whenever I have run the app in browser using
ionic cordova run browser
It display below issue in console,
Native: tried calling HTTP.post, but the HTTP plugin is not installed.
Install the HTTP plugin: 'ionic cordova plugin add cordova-plugin-advanced-http'.
I have installed same plugin using terminal but terminal give warnings as its already installed.
Please Suggest.
Based on this https://ionicframework.com/docs/native/http/ you also need to run
npm install --save #ionic-native/http
and referencing it correctly in your app, please take a look at above link
Also for running app in browser try below command
Ionic serve
See https://github.com/ionic-team/ionic-native/issues/1975
The issue appears to have been fixed but there might be a lag in updating npm
I hade the same problem and I solve it with uninstall and reinstall the plugin
Uninstall plugin completely
ionic cordova plugin remove cordova-plugin-advanced-http
npm uninstall #ionic-native/http
and reinstall it
ionic cordova plugin add cordova-plugin-advanced-http
npm install #ionic-native/http
The Native Http plugin is the only way to handle the CORS from the client-side.
The way I see your problem, there might two possible fixes
Check whether the plugin is called after the platform.ready().
Even after it, if doesn't work or show the same error then follow this method.
// Declare cordova as a global constant
declare const cordova;
// directly call the cordova pulgin using "cordova.pulgin.http"
cordova.plugin.http.post(apiUrl, {}, {},
response => {},
response => {})

Ember build for production not building properly

I am building my ember app in production environment and deploying it on my local wamp server(apache server). But when I copy the file and open the app using url, the handlebar template application.hbs or index.hbs is not rendered.
I am building my project using
ember build --environment production --output-path dist/
But when I open the path 127.0.0.1/path-to-my-project
I get following error in console.
Uncaught Error: Could not find module `ember-data/-private\system\references\record` imported from `ember-data/-private/system/references`
vendor-192d3eef66f0205b64b4acf903f80f63.js:1
I am getting this error when building in production environment,building in development environment is working fine
I checked the documentation and sources available online, but couldn't find the cause for this error.
Please Help...
On Windows, it's mixing / and \s. See:
https://github.com/emberjs/data/pull/4205
If you're using the latest Ember, the solution is to upgrade to Ember-Cli 2.4.2 and use Ember Data 2.4.0.

Error installing ember-cli-mocha

I'm trying to setup an EmberJS project using ember-cli. I want to be able to use Mocha/Chai instead of the default qunit, but I am getting an error at the first step on installing ember-cli-mocha.
I create the new ember project with ember new my-project and then from within the project folder I run ember install ember-cli-mocha, selecting Yes to overwrite the tests/test-helper.js.
In the output, immediately following the Installed browser packages via Bower. message I see:
Package ember-cli/ember-cli-test-loader=ember-cli/ember-cli-test-loader not found
I can't find any information on this directly. I've tried installing the various packages themselves, before the ember-cli-mocha package via npm and bower, but I always get that message when installing ember-cli-mocha through ember-cli.
Anyone else have experience with this? Thanks in advance!

Was ember cli 0.2.0-beta.1 released as 0.2.0 resulting in 'SyntaxError: Unexpected token <'?

While trying to figure out how to recreate an ember app which I can't migrate to CLI, and use 'generate' to create resources, and routes with paths and dynamic segments, I was creating and deleting a test app several times. At one point it seems that ember cli tried to update to 0.2.0 and I got warnings about npm packages wanting an older version of node, so I changed the versions in the package json files for those. But when creating a new starter ember app, I get the 'SyntaxError: Unexpected token <' error (update-checker.js, _stream_writable.js, etc).
So I ran 'npm uninstall -g ember-cli' then 'npm install -g ember-cli#0.2.0-beta.1' to get beta back and now I can create starter apps again.
This issue with dependencies being out of line was probably temporary since revisions within CLI are happening so fast. If I came back the next day and cleared out module and component cache and started over, it probably would have cleared up. By reverting CLI manually I wound up with other issues with express live update, so would have to stop and restart express after every edit. I realized I wasn't ready to re-write my gruntfile as a brocfile and deal with all the other issues with migrating to Ember CLI, so started over by updating the Ember dependency in my grunt-based project and going that route, which is also frustrating and hugely problematic, but I'm sure I'm farther along in this route than I would have been in re-writing for Ember CLI.

Is the ember cli addon installation broken in Ember Cli 0.1.11?

I'm using ember cli for some small test projects to evaluate the concepts. Normal use of ember cli works for me. After 10 created small projects and using blueprints and the pod structure I decided to try the development and usage of addons. The creation of addons was not the real problem.
The problem is I can not successfully install a created addon. I also tried to install other addons created by other ember-cli users. The result is always the same. I got no error message and the addon could be found inside the node_modules directory of the addon consuming application but there is nothing installed in the app directory and it's sub directories !!!
What can I do to find the problem ?
Do you have a public available addon which could be installed definitely without problems ?
Are there log files which could be inspected to see more details (hidden error messages) ?
Best regads
Andreas
The current Ember CLI version is 0.0.12. I'm not aware of any issues with addon installations. If the issue persist, you should create an issue on ember-cli issue tracker.