Have Error while try to Update Ember 2.14.2 to Ember 2.18.2 - ember.js

Anyone please help me with Ember update.My current code base was 2.14.2 and I try to update 2.18.2.And I got the below error.
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
Cannot find module
'/sampleApp/bower_components/ember/ember-template-compiler.js'
Anyone, please guide me with this. If you have another method to upgrade the version of ember please let me know or please help to solve the issue.
Update
Full stack track:
Log File Source
`ENV Summary:
ERROR Summary:
- broccoliBuilderErrorStack: [undefined]
- code: MODULE_NOT_FOUND
- codeFrame: [undefined]
- errorMessage: Cannot find module
'/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember-
template-compiler.js'
- errorType: [undefined]
- location:
- column: [undefined]
- file: [undefined]
- line: [undefined]
- message: Cannot find module
'/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember-
template-compiler.js'
- name: Error
- nodeAnnotation: [undefined]
- nodeName: [undefined]
- originalErrorMessage: [undefined]
- stack: Error: Cannot find module
'/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember-
template-compiler.js'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Class.htmlbarsOptions (/Users/mariselvan/Documents/sampleApp/node_modules/ember-inplace-edit/node_modules/ember-cli-htmlbars/ember-addon-main.js:78:25)
at Object.toTree (/Users/mariselvan/Documents/sampleApp/node_modules/ember-inplace-edit/node_modules/ember-cli-htmlbars/ember-addon-main.js:31:36)
at /Users/mariselvan/Documents/sampleApp/node_modules/ember-cli-preprocess-registry/preprocessors.js:180:26
at Array.forEach (<anonymous>)
at processPlugins (/Users/mariselvan/Documents/sampleApp/node_modules/ember-cli-preprocess-registry/preprocessors.js:178:11)
at module.exports.preprocessTemplates (/Users/mariselvan/Documents/sampleApp/node_modules/ember-cli-preprocess-registry/preprocessors.js:161:10)
=================================================================================
Ember-Cli version of the project :
ember-cli: 2.14.2
node: 10.13.0
os: darwin x64
Thanks in advance.

I remember experiencing something like this around the late 2.x of ember. Basically, ember switched from bower to npm around 2.11 or so.
Are you using the ember-source npm version of ember? Your template compiler lookup is searching within bower which is most likely wrong if you've properly made the switch to npm, which you should have!
There's this issue that was fixed which may be the cause for you. Often times, updating the ember
version alone isn't enough. For me, it was always easiest to update to the ember-cli version whose blueprint installed the version of ember that you are wanting (which will help you know what other core dependencies need updating). Looking through old release notes helps here.
If you are using an old ember-cli-htmlbars-inline-precompiler, you need to upgrade to:
"ember-cli-htmlbars-inline-precompile": "^0.3.6"
If it's not either of those, please update your question with the full stack trace and the ember-cli version
EDIT: I'd like to help enable you to solve this issue yourself in the future so here's the detailed breakdown of how I reach my conclusion. In your stack trace, we see:
/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember-
template-compiler.js
This is looking for ember in bower which is no longer the case since you have ember-source in your package.json. This error results from
at Class.htmlbarsOptions (/Users/mariselvan/Documents/sampleApp/node_modules/ember-inplace-edit/node_modules/ember-cli-htmlbars/ember-addon-main.js:78:25)
So the conclusion here is that the version of ember-inplace-edit is old and you need to upgrade or fix yourself. Look at this addon's package.json and it's got this fixed dependency:
"dependencies": {
"ember-cli-babel": "^5.1.3",
"ember-cli-htmlbars": "0.7.9" // this was released Jun 12, 2015
}
For the record, my ember 2.18 app bundled "ember-cli-htmlbars": "^2.0.1" by default. So lets go to the release of 0.7.9, download the source code, and look at the offending line in :
templateCompilerPath: function() {
var config = this.projectConfig();
var templateCompilerPath = config['ember-cli-htmlbars'] && config['ember-cli-htmlbars'].templateCompilerPath;
if (!templateCompilerPath) {
// THIS ONLY WORKS FOR BOWER VERSIONS OF EMBER
templateCompilerPath = this.project.bowerDirectory + '/ember/ember-template-compiler';
}
return path.resolve(this.project.root, templateCompilerPath);
}
So you have a couple of reasonable options
Fix the addon and make it support later Ember versions and open a PR to get merged upstream (by updating this ember cli htmlbars dependency)
Fork the addon and fix it without merging upstream and point to your fork
Remove the addon and rework this part of your application
use the templateCompilerPath option to point to your ember-source version (but this is honestly the worst option)

Related

Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'

I've recently updated ember-cli and my app to 4.10.0, and trying to build with:
ember serve
throws the following error:
Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'
I've looked to see what module is missing. I came up with trying to install/reinstall ember-cli-babel and that didn't work either.
The ember app is on LAMP: Raspbian Linux 11 OS, Apache 2.4.54, MariaDB 10.5.15, and PHP/Laravel 8 backend
ember-cli: 4.10.0
ember-source: 4.10.0
ember-cli-babel: 7.26.11
I don't have any special ember-cli-build configurations, here it is:
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
});
return app.toTree();
}
EDIT: ERROR STACK
- name: Error
- nodeAnnotation: [undefined]
- nodeName: [undefined]
- originalErrorMessage: [undefined]
- stack: Error: Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'
Require stack:
- /var/www/html/.../node_modules/#ember-data/private-build-infra/src/debug-macros.js
- /var/www/html/.../node_modules/#ember-data/private-build-infra/src/stripped-build-plugins.js
- /var/www/html/.../node_modules/#ember-data/private-build-infra/src/addon-build-config-for-data-package.js
- /var/www/html/.../node_modules/ember-data/index.js
- /var/www/html/.../node_modules/ember-cli/lib/models/package-info-cache/package-info.js
- /var/www/html/.../node_modules/ember-cli/lib/models/package-info-cache/index.js
- /var/www/html/.../node_modules/ember-cli/lib/models/project.js
- /var/www/html/.../node_modules/ember-cli/lib/utilities/get-config.js
- /var/www/html/.../node_modules/ember-cli/lib/utilities/instrumentation.js
- /var/www/html/.../node_modules/ember-cli/lib/cli/index.js
- /usr/local/lib/node_modules/ember-cli/bin/ember
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Function.resolve (node:internal/modules/cjs/helpers:109:19)
at debugMacros (/var/www/html/.../node_modules/#ember-data/private-build-infra/src/debug-macros.js:6:44)
at module.exports (/var/www/html/.../node_modules/#ember-data/private-build-infra/src/stripped-build-plugins.js:11:48)
at Class.buildBabelOptions (/var/www/html/.../node_modules/#ember-data/private-build-infra/src/addon-build-config-for-data-package.js:149:62)
at Class._setupBabelOptions (/var/www/html/.../node_modules/#ember-data/private-build-infra/src/addon-build-config-for-data-package.js:168:33)
at Class.included (/var/www/html/.../node_modules/#ember-data/private-build-infra/src/addon-build-config-for-data-package.js:184:12)
at Class.superWrapper [as included] (/var/www/html/.../node_modules/core-object/lib/assign-properties.js:34:20)
at /var/www/html/.../node_modules/ember-cli/lib/models/addon.js:497:26
at Array.reduce (<anonymous>)
at Class.eachAddonInvoke (/var/www/html/.../node_modules/ember-cli/lib/models/addon.js:494:24)
at Class.included (/var/www/html/.../node_modules/ember-cli/lib/models/addon.js:769:10)
at Class.superWrapper [as included] (/var/www/html/.../node_modules/core-object/lib/assign-properties.js:34:20)
at Class.included (/var/www/html/.../node_modules/#ember-data/private-build-infra/src/addon-build-config-for-data-package.js:174:28)
at Class.superWrapper [as included] (/var/www/html/.../node_modules/core-object/lib/assign-properties.js:34:20)
at /var/www/html/.../node_modules/ember-cli/lib/broccoli/ember-app.js:721:15
After days of googling and trying a variety of things, I was able to get my ember application to launch again. Here is what worked for me, for whatever reason.
I removed all the files inside my projects node_modules directory
sudo rm -r node_modules/*
and reinstalled all those packages with
npm install
After this, and I'm not sure if this really had anything to do with the resolution, I updated npm from 9.4.1 to 9.4.2
npm install -g npm#9.4.2
Once all of those commands executed successfully, I ran
ember serve
and I no longer received the above error.
I hadn't thought I ever used sudo to install any npm packages, at least I try to make it a habit not to. But, it's possible I screwed up during my many butchered attempts at updating my ember app from 4.9 to 4.10.

New Ember project: The "data" argument must be of type string or an instance

I used the cli to create a new Ember project (v2.18). I'm getting the following error when I try to build/serve the project. This is with 100% clean project, no edits yet. Also fwiw, am using node v14.19.3, npm v6.14.17.
- stack: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Object.writeFileSync (fs.js:1522:5)
at module.exports (/Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/lib/utilities/attempt-never-index.js:26:6)
at Builder.build (/Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/lib/models/builder.js:156:5)
at BuildTask.run (/Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/lib/tasks/build.js:29:20)
at /Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/lib/models/command.js:243:46
at tryCatcher (/Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:326:21)
at invokeCallback (/Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:498:33)
at /Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:562:16
at flush (/Users/nikoleizinsli/IdeaProjects/custom-fields-admin/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:2441:7)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
UPDATE: I was able to get it to build by using Node v13. We have another Ember 2.18 project that compiles fine on Node v14...so not sure what is causing this.
Any reason you're using that version of Ember? It stopped getting updates in 2018. I'd guess this is an issue with Node 14, you may need to go back to Node 10 to get support for ember-cli 2.18. Or, even better, run npm install -g ember-cli to get the 4.4 version which supports Node 14+.

Ember build error: Assertion Failed: [BUG] seen set should be available

Trying to update a Rails/Ember app and running into this error:
Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in ember-basic-dropdown/templates/components/basic-dropdown/content.hbs
Assertion Failed: [BUG] seen set should be available
Googled far and wide, but have not been able to find a fix. The only thing I found was this GitHub issue. Downgrading to 3.20.0 did not solve the issue.
Relevant packages:
"ember-cli": "^3.27.0",
"ember-data": "~3.26.0",
Update ember-power-select to the latest version will fix this issue.
As this is an issue with ember-basic-dropdown, you can use
npm ls ember-basic-dropdown
to find which packages is using it as a dependency (most probably ember-power-select.
Once you find out, update that package and the problem should be resolved.

TypeError: Cannot read property 'serve:before' of undefined on Ionic CLI 2.2.1 + Gulp 4

I am developing a Web Application that have a lot of legacy dependencies.
On the trial of updating some packages, I updated the gulp/gulpfile.js and tinkered then to run. Gulp was on version 3.5 and now is on 4.0.
By the way, the error thrown in the terminal by running : ionic serve --address localhost --nobrowser is :
Error: spawn cordova EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please update your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
TypeError: Cannot read property 'serve:before' of undefined
at Object.runWithGulp (/usr/lib/node_modules/ionic/lib/cli.js:237:17)
at Object.runr (/usr/lib/node_modules/ionic/lib/cli.js:194:18)
at /usr/lib/node_modules/ionic/lib/cli.js:54:9
at _fulfilled (/usr/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at /usr/lib/node_modules/ionic/node_modules/q/q.js:816:30
at Promise.promise.promiseDispatch (/usr/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at process._tickCallback (internal/process/next_tick.js:61:11)
Cannot read property 'serve:before' of undefined (CLI v2.2.1)
Your system information:
Cordova CLI: undefined
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 5.4
Node Version: v10.16.3
Xcode version: Not installed
Then, some patch of the gulpfile.js :
gulp.task('build', gulp.series('bundle', 'copyTask', 'revTask', 'revReplaceTask'));
gulp.task('default', gulp.series('sassTask', 'cleanTask', 'build', 'watchTask'));
gulp.task('serve:before', gulp.series('cleanTask', 'watchTask', 'build'));
Before the tinkering, gulp.task('serve:before' [...]) functioned well. I guess it is related with the Ionic 2.2.1 CLI.
If someone could help me by a hint or an advice for mismatching the problem, I would be glad.
This happened to me while I upgraded Node to v12 which forced me to upgrade Gulp to v4.
The solution that worked for me is:
Go to npm\node_modules\ionic\lib\cli.js (Wherever it's located).
Change the following lines as such in cli.js:
237: if (true || gulp.tasks[beforeHook]) {
257: if (true || gulp.tasks[afterHook]) {
270: return Q.nfcall(null/*gulp.start.bind(gulp)*/, hookName)
Basically, the reason is that gulp.tasks and gulp.start don't exist in Gulp v4.
By putting true || in the first occurrences, gulp.tasks won't run and by putting null in the last occurrence, the gulp.start won't run.
I hope this helps the next people that encounter this problem.

ember-data issue in bower.json

i have an ember-cli app which has ember-data in both bower.json and package.json. I was facing the issue
The package `ember-data` is not a properly formatted package, we have used a fallback lookup to resolve it at `LOCATION`. This is generally caused by an addon not having a `main` entry point (or `index.js`).
I found out that updating ember-data to beta16 or above. So i thought of updating using
npm install ember-data --save-dev.
This would update package.json to "ember-data": "^1.0.0-beta.18", now in order to update bower as well i did
bower install ember-data --save. Now it gave me options to choose twice which are
1> For this i chose !3
Unable to find a suitable version for ember-data, please choose one:
1) ember-data#~0.0.14 which resolved to 0.0.14
2) ember-data#1.0.0-beta.14.1 which resolved to 1.0.0-beta.14.1 and is required by text-admin
3) ember-data#~1.0.0-beta.7 which resolved to 1.0.0-beta.18 and is required by ember-qunit#0.1.8Prefix the choice with ! to persist it to bower.json
2> For this i chose !3 since i was using ember1.12.0.
Unable to find a suitable version for ember, please choose one:
1) ember#~1.0.0 which resolved to 1.0.1 and is required by ember-data#0.0.14
2) ember#>= 1.8.1 < 2.0.0 which resolved to 1.12.0 and is required by ember-data#1.0.0-beta.14.1, ember-data#1.0.0-beta.18
3) ember#~1.12.0 which resolved to 1.12.0 and is required by text-admin
4) ember#>=1.4 <2 which resolved to 1.12.0 and is required by ember-cli-shims#0.0.3
5) ember#> 1.5.0-beta.3 which resolved to 1.12.0 and is required by ember-resolver#0.1.14
6) ember#^1.3.0 which resolved to 1.12.0 and is required by ember-qunit#0.1.8Prefix the choice with ! to persist it to bower.json
However this only ended up in ember-data becoming
"ember-data": "~1.0.0-beta.7" under resolutions and "ember-data": "~0.0.14" in dependencies.
My Questions:
How to get bower.json to update ember-data to "ember-data": "^1.0.0-beta.18"?
Why is ember-data present in both bower.json and package.json?
You need to update it in both bower.json and package.json. The purpose of this is you don't have to invoke ember g ember-data when creating a new project with ember-cli. So in order to update write in both files "ember-data": "^1.0.0-beta.18".
I know this is a bit old but I still think it will help someone. Also ember-data is now upgraded to 1.13.14 as of today.
#wallop: I think you've already got the answer for your second question. For the first question, to install a specific version of a bower component, you can try the following command. It might still ask for the option but I have experienced that it works as you wanted.
bower install --save ember-data#1.0.0-beta.18