Moving ember-data-model-fragments from bower to packjage.json

Hi

I am updaring an old Ember app 1.13 to Ember 3 eventually but at the stage of moving to Ember 2.13 at the moment.

I have fixed all the code issues but now I get a problem when trying to move ember-data-model-fragments out of Bower and use NPM instead

I get the error below - I have deleted the tmp/ dir and the dist/ dir too

I have done cache clean for NPM and Bower (just in case) and still no luck , any ideas ?

Build failed.
Build Canceled: Broccoli Builder ran into an error with `SourceMapConcat` plugin. 💥
ENOENT: no such file or directory, open '/Users/user/Development/Homestead/sites/newalt/project/orders/tmp/source_map_concat-input_base_path-2AUIZjUr.tmp/bower_components/ember-data-model-fragments/dist/ember-data-model-fragments.js'


{
  "name": "Cust",
  "version": "1.0.0",
  "description": "Creates and dispatches customers",
  "engines": {
"node": ">= 4"
  },
  "private": true,
  "author": "",
  "directories": {
"doc": "doc",
"test": "tests"
  },
  "repository": "",
  "scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test",
  },
  "devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-aupac-typeahead": "2.1.2",
"ember-cli": "2.13.0",
"ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^6.0.0",
"ember-cli-bootstrap-sassy": "0.5.5",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-eslint": "^3.0.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-md5": "0.1.0",
"ember-cli-moment-shim": "3.0.1",
"ember-cli-qunit": "^4.0.0-beta.1",
"ember-cli-sass": "6.0.0",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-tinymce": "0.1.5",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.13.0",
"ember-data-model-fragments": "1.13.3",
"ember-export-application-global": "^2.0.0",
"ember-font-awesome": "2.2.0",
"ember-load-initializers": "^1.0.0",
"ember-moment": "7.3.0",
"ember-resolver": "^4.0.0",
"ember-simple-auth": "1.0.1",
"ember-simple-auth-token": "^1.0.0",
"ember-source": "~2.13.0",
"ember-welcome-page": "^3.0.0",
"liquid-fire": "0.24.1",
"loader.js": "^4.2.3"
  },
  "license": "MIT",
  "dependencies": {
"font-awesome": "^4.7.0",
"git-repo-info": "^2.0.0"
  }
}

So… it’s been a while but it looks like it’s still trying to use the bower package which means in your build script it’s probably trying to import it. In the main build script (in modern Ember it’s called ember-cli-build.js but it used to be called something different and I can’t remember the name, sorry!) there are usually lines that import scripts from bower packages. Make sure you have any of those that you’re not using cleared out. That’s my guess as to what’s causing this but if that’s not it maybe do a search of the repo for ember-data-model-fragments and see if anything else is trying to import it?

Thanks for the reply apologies I forgot to check back - just in case this helps anyone in the future I will put my fix below

The issue was with ember-data in the package.json having an ^ in front of it "ember-data": "^2.13.0",

This was causing an issue because it was just using a higher version of ember-data. Once i took out the ^ it all worked.

This problem I faced after this was that the version of ember-data-model-fragments has to be correct for their version of ember-data which is being used more information can be found on the github page for the ember-data-model-fragments (look for a table of compatible versions )

The highest i got to was ember 3.12.0 after that ember-data-model-fragments won’t work so you either have to re-write the code you are using or wait for someone to update the package

1 Like