Uncaught Error: Could not find module `ember-load-initializers` - ember.js

i am getting error after running compiled ember rails application. Here is the error while inspecting the page.
Uncaught Error: Could not find module `ember-load-initializers` imported from `(require)`
Uncaught Error: Could not find module `active-model-adapter` imported from `account-settings/initializers/active-model-adapter`
here is my bower.json and package.json files:
{
"name": "account-settings",
"dependencies": {
"ember": "^2.0",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-data": "^2.0",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.16",
"ember-qunit-notifications": "0.1.0",
"ember-resolver": "~0.1.20",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.4.0",
"qunit": "~1.20.0"
}
}
package file:
{
"name": "account-settings",
"version": "0.0.0",
"description": "Small description for account-settings goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"active-model-adapter": "2.0.3",
"broccoli-asset-rev": "^2.2.0",
"ember-cli": "1.13.13",
"ember-cli-app-version": "^1.0.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-coffeescript": "1.13.2",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-emblem": "0.3.1",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-ic-ajax": "0.2.4",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.4",
"ember-cli-rails-addon": "0.0.13",
"ember-cli-release": "0.2.8",
"ember-cli-sri": "^1.2.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "1.13.15",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-radio-button": "1.0.7",
"emberx-select": "2.0.2",
"phantomjs": "^2.1.3"
}
}
Can you please suggest the solution?

This could be a related to issue #5316 in ember-cli#1.13.13.
As mentioned in the issue thread, you could either try updating ember-cli to 1.13.14 or pinning jQuery to 1.11.3 in your bower.json to solve it.

It seems that its due to a bug of ember with the new version of jquery.I simply downgraded the jquery version in my bower file.
Take a look at two following link:
1- Uncaught Error: Could not find module `ember` imported from `ui/app` loader.js:164
2- Getting "Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1" with app created through ember-cli

Related

Storybook - Ember.js - Getting stuck on loading state

I've installed storybook/ember on an existing Ember project, but unfortunatelly it stuck on loading screen with no error - doesn't display the welcome page and shows the spinner instead.
.storybook/main.js
module.exports = {
"stories": [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.#(js|jsx|ts|tsx)"
],
"addons": [
"#storybook/addon-links",
"#storybook/addon-essentials"
]
}
I haven't touched anything in the stories or .storybook (everythins is the default).
package.json
{
"name": "web-ui",
"version": "0.0.0",
"description": "Small description for web-ui goes here",
"repository": "",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"private": true,
"scripts": {
"build": "ember build",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test -r xunit",
"coverage": "COVERAGE=true ./node_modules/.bin/ember test --silent",
"storybook": "start-storybook -p 6006 -s dist",
"build-storybook": "build-storybook -s dist"
},
"engines": {
"node": ">= 10.*"
},
"devDependencies": {
"#babel/core": "7.11.6",
"#ember/jquery": "1.1.0",
"#ember/optional-features": "2.0.0",
"#glimmer/component": "1.0.1",
"#storybook/addon-actions": "^6.0.22",
"#storybook/addon-essentials": "^6.0.22",
"#storybook/addon-links": "^6.0.22",
"#storybook/ember": "^6.0.22",
"acorn": "^8.0.1",
"babel-eslint": "10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-ember-modules-api-polyfill": "^3.1.1",
"babel-plugin-htmlbars-inline-precompile": "^4.2.0",
"bootstrap": "3.4.1",
"broccoli-asset-rev": "3.0.0",
"broccoli-funnel": "3.0.3",
"broccoli-merge-trees": "4.2.0",
"browser": "0.2.6",
"d3": "6.1.1",
"ember-ajax": "5.0.0",
"ember-auto-import": "1.6.0",
"ember-can": "3.0.0",
"ember-cli": "3.16.0",
"ember-cli-app-version": "3.2.0",
"ember-cli-babel": "7.22.1",
"ember-cli-code-coverage": "1.0.0",
"ember-cli-content-security-policy": "1.1.1",
"ember-cli-dependency-checker": "3.2.0",
"ember-cli-document-title-northm": "1.0.3",
"ember-cli-htmlbars": "5.3.1",
"ember-cli-inject-live-reload": "2.0.2",
"ember-cli-json-module": "1.0.0",
"ember-cli-jstree": "1.0.12",
"ember-cli-less": "3.0.1",
"ember-cli-mirage": "1.1.8",
"ember-cli-nouislider": "1.2.1",
"ember-cli-pagination": "3.1.5",
"ember-cli-sri": "2.1.1",
"ember-cli-template-lint": "1.0.0-beta.3",
"ember-cli-test-loader": "3.0.0",
"ember-cli-uglify": "3.0.0",
"ember-data": "3.16.0",
"ember-diff-attrs": "0.2.2",
"ember-disable-proxy-controllers": "1.0.2",
"ember-export-application-global": "2.0.1",
"ember-flatpickr": "2.16.2",
"ember-infinity": "2.1.2",
"ember-inflector": "3.0.1",
"ember-inline-svg": "1.0.0",
"ember-intl": "5.4.2",
"ember-load-initializers": "2.1.1",
"ember-math-helpers": "2.15.0",
"ember-maybe-import-regenerator": "0.1.6",
"ember-power-select": "3.0.4",
"ember-qunit": "4.6.0",
"ember-radio-button": "2.0.1",
"ember-resolver": "7.0.0",
"ember-simple-auth": "2.1.1",
"ember-source": "3.16.0",
"ember-storage": "2.0.0",
"ember-table": "2.2.3",
"ember-template-lint": "1.13.2",
"ember-tooltips": "3.4.5",
"ember-truth-helpers": "2.1.0",
"ember-vega": "1.1.5",
"emberx-select": "3.1.1",
"eslint": "5.16.0",
"eslint-plugin-ember": "7.7.2",
"eslint-plugin-node": "11.1.0",
"jquery-mockjax": "2.6.0",
"jshint": "2.12.0",
"json-merger": "1.1.2",
"loader.js": "4.7.0",
"material-design-icons-iconfont": "4.0.5",
"minimatch": "3.0.4",
"node-gyp": "6.0.0",
"qunit-dom": "1.5.0",
"react-is": "^16.13.1",
"request": "2.88.2",
"rsvp": "4.8.5",
"valid-url": "1.0.9",
"vega-lib": "4.4.0",
"yaml-lint": "1.2.4"
},
"dependencies": {
"#ember/test-helpers": "^1.7.2",
"#storybook/core": "^6.0.22",
"core-js": "^3.6.5",
"faker": "^4.1.0",
"global": "^4.4.0",
"regenerator-runtime": "^0.13.7",
"semver": "^6.3.0",
"ts-dedent": "^2.0.0"
}
}
Any help/suggestions are appreciated.
You need to make sure to run ember install #storybook/ember-cli-storybook after running npx sb init, this will make sure that the ember adapter is installed.
Once you've made thoses steps, make sure to first run your ember app (ie ember s nor ember build) then once the app is built, you can run storybook as you've done.
This is due to a limitation because today the install steps are a bit broken and need to be fixed, that's why we need to run thoses extra steps!
Let me know if you got any questions :)

Ember-CLI v0.0.44 project not building with a "Use of const in strict mode." error message

I need to update a template in a fairly outdated ember project (its about 5 years old) but I'm unable to build it.
Here is the working environment:
Nodejs v0.10.46 (via NVM)
NPM v2.15.1
Ember-CLI v0.0.44
Ember 1.8.1
Bower
Here are the contents of the package.json file:
{
"name": "xxxxx",
"version": "0.0.0",
"private": true,
"directories": {
"doc": "doc",
"test": "test"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": "https://github.com/stefanpenner/ember-cli",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"body-parser": "^1.2.0",
"broccoli-asset-rev": "0.0.17",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"connect-restreamer": "^1.0.0",
"ember-cli": "0.0.44",
"ember-cli-ember-data": "0.1.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.0.2",
"ember-cli-qunit": "0.1.0",
"express": "^4.8.5",
"glob": "^4.0.5"
}
}
Here are the contents of the bower.json file:
{
"name": "eam-ui",
"dependencies": {
"handlebars": "~1.3.0",
"ember": "1.8.1",
"jquery": "^1.11.0",
"ember-resolver": "~0.1.7",
"loader": "stefanpenner/loader.js#1.0.1",
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.4",
"qunit": "~1.15.0",
"foundation": "~5.4.7",
"ember-i18n": "~2.2.1",
"cldr": "~1.0.2",
"es5-shim": "~4.0.1",
"e164-phones-countries": "~1.0.3",
"FileSaver.js": "koffsyrup/FileSaver.js"
},
"resolutions": {
"jquery": "^1.11.0"
}
}
Building the app produces the following output:
ember build
version: 0.0.44
/Users/xxxxxx/Documents/proj1050/xxxxx/node_modules/ember-cli-inject-live-reload/index.js:3
const buildLiveReloadPath = require('clean-base-url');
^^^^^
Use of const in strict mode.
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Function.Addon.lookup (/Users/xxxxxx/Documents/proj1050/xxxxx/node_modules/ember-cli/lib/models/addon.js:270:19)
I know this project is SUPER outdated. Any thoughts on what I can do resolve this build issue? Or should I start planning my escape???
Thanks in advance!
Yes this is old. :)
You can fix this one particular issue by changing one line in package.json from:
"ember-cli-inject-live-reload": "^1.0.2",
to
"ember-cli-inject-live-reload": "1.0.3",
Good luck.

Ionic unit testing: webpack version

I've been trying to set up a testing example according to the common guidelines: Testing in Ionic, Ionic GitHub Example
My project's package.json:
{
"name": "starter-with-testing",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"test": "karma start ./test-config/karma.conf.js"
},
"dependencies": {
"#angular/animations": "5.2.11",
"#angular/common": "5.2.11",
"#angular/compiler": "5.2.11",
"#angular/compiler-cli": "5.2.11",
"#angular/core": "5.2.11",
"#angular/forms": "5.2.11",
"#angular/http": "5.2.11",
"#angular/platform-browser": "5.2.11",
"#angular/platform-browser-dynamic": "5.2.11",
"#ionic-native/core": "4.7.0",
"#ionic-native/splash-screen": "4.7.0",
"#ionic-native/status-bar": "4.7.0",
"#ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"#ionic/app-scripts": "^3.1.10",
"#types/jasmine": "^2.8.8",
"#types/node": "^10.3.4",
"angular2-template-loader": "^0.6.2",
"html-loader": "^0.5.5",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine": "^3.1.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^2.0.3",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^1.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.0",
"null-loader": "^0.1.1",
"protractor": "^5.3.2",
"ts-loader": "^4.4.1",
"ts-node": "^6.1.2",
"typescript": "~2.6.2"
},
"description": "An Ionic project"
}
Attempt at $ npm test results in an error:
Chrome 67.0.3396 (Linux 0.0.0) ERROR
{
"message": "An error was thrown in afterAll\nUncaught Error: Module build failed: Error: You may be using an old version of webpack; please check you're using at least version 4\n at successfulTypeScriptInstance (/home/alexey/spaces/cordova/starter-with-testing/node_modules/ts-loader/dist/instances.js:168:15)\n at Object.getTypeScriptInstance (/home/alexey/spaces/cordova/starter-with-testing/node_modules/ts-loader/dist/instances.js:51:12)\n at Object.loader (/home/alexey/spaces/cordova/starter-with-testing/node_modules/ts-loader/dist/index.js:16:41)"
That is, webpack 4.x required. Indeed,
$ npm list webpack
starter-with-testing#0.0.1 /home/alexey/spaces/cordova/starter-with-
testing
└─┬ #ionic/app-scripts#3.1.10
└── webpack#3.8.1
What am I supposed to do?
UPD:
I've got It looks like your post is mostly code; please add some more details. fatal error. Your question couldn't be submitted.
I'm really at a loss about more details. There is a dependency hell; please, help. I'll humbly submit whatever additional details you ask.
I had the same problem, and fixed it by downgrading my ts-loader and ts-node to the versions used in the ionic-unit-testing-example repository.
I.e. in package.json:
{
//...
"devDependencies": {
//...
"ts-loader": "^3.0.3",
"ts-node": "^3.0.2",
//...
}
//...
}
It's ts-loader that's complaining, so I'm not sure if the ts-node downgrade is actually required.
I solved the same error by simply give npm i webpack#latest.
I didn't have any custom configuration made so it seems to work now. I just found it takes really long time to compile but I haven't looked at it.

Ember cli 0.1.15 Path or pattern "ember-data.js.map" did not match any files

I just upgrade my ember cli project and now get this error when running ember server.
Path or pattern "ember-data.js.map" did not match any files
I noticed a post here but doesn't help my case
https://github.com/emberjs/data/issues/2557
package
{
"name": "cli",
"version": "0.0.0",
"description": "Small description for cli goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"body-parser": "^1.2.0",
"broccoli-asset-rev": "^2.0.0",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"ember-cli": "0.1.15",
"ember-cli-6to5": "^3.0.0",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-htmlbars": "^0.6.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-less": "^1.0.5",
"ember-cli-qunit": "0.3.1",
"ember-cli-app-version": "0.3.1",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.14.1",
"ember-export-application-global": "^1.0.0",
"ember-select-2": "^1.1.1-beta1",
"ember-validations": "2.0.0-alpha.1",
"express": "^4.8.5",
"glob": "^4.0.5"
}
}

Ember 1.10.0 throws "Uncaught Error: Bound attributes are not yet supported in Ember.js"

I just changed this:
<div {{bind-attr class=":step category.isCurrent:active category.isBeforeCurrent:visited"}}>
to this:
<div class="step {{category.isCurrent:active}} {{category.isBeforeCurrent:visited}}">
and now get:
Uncaught Error: Bound attributes are not yet supported in Ember.js
Here is the bower.json I am using:
{
"name": "proj",
"dependencies": {
"jquery": "^1.11.1",
"ember": "1.10.0",
"ember-data": "^1.0.0-beta.14.1",
"ember-resolver": "~0.1.11",
"loader.js": "ember-cli/loader.js#1.0.1",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.4",
"qunit": "~1.15.0"
}
}
And my package json :
{
"name": "proj",
"version": "0.0.0",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.0",
"ember-cli": "0.1.7",
"ember-cli-6to5": "0.2.1",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-htmlbars": "^0.6.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-less": "^1.1.0",
"ember-cli-qunit": "0.1.2",
"ember-data": "^1.0.0-beta.14.1",
"ember-export-application-global": "^1.0.0",
"express": "^4.8.5",
"glob": "^4.0.5"
}
}
I followed the steps in the migration guide so not sure what is wrong. On the whole I do like these new changes though, the future is bright.
Attribute binding is in Ember 1.11, not 1.10. The blog post for the 1.10 release talks more about this upcoming feature.