Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ember Data: DS is not defined

  • Loading branch information...
commit 8f82a1eb84da060fdfc60b92761c19026d7dd702 1 parent 935dd18
@steveklabnik authored
Showing with 34 additions and 0 deletions.
  1. +34 −0 posts/2015-07-05-ember-data--ds-is-not-defined.md
View
34 posts/2015-07-05-ember-data--ds-is-not-defined.md
@@ -0,0 +1,34 @@
+---
+title: "Ember Data: DS is not defined"
+date: 2015-07-05 14:45
+---
+
+I’m doing a little Ember app, and if there’s one thing I’ve learned from
+writing software, it’s to blog about error messages. Two-years-later me has
+ended up finding my own posts when searching for help!
+
+So today, when getting started with Ember Data 1.13, I was trying to use the
+new `JSONAPIAdapter`. I saw this code snippet:
+
+```
+App.ApplicationAdapter = DS.JSONAPIAdapter.extend({
+ namespace: 'v1',
+});
+```
+
+Using that gave me an error when `ember serve`-ing, though:
+
+```
+app.js: line 16, col 26, ‘DS’ is not defined.
+```
+
+Turns out, `DS` isn’t in scope by default, even though `ember-cli` installs
+Ember Data by default.
+
+Fixing this just means importing it at the top of `app/app.js`:
+
+```
+import DS from 'ember-data';
+```
+
+Easy enough!
Please sign in to comment.
Something went wrong with that request. Please try again.