添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I have an existing app and tried to get mirage working with it.

export default function () {
this.namespace = '/api/v0';   
  this.timing = 2000;  
  this.get('/accounts', function () {
    console.log("yoooooooooo");
    return{
      users: [
        { id: '1', email: 'joe@myapp.io' },
        { id: '2', email: 'mark@myapp.io' },
  this.post('/api/login', function(req, res) {
    res.send({
      id: '1',
      token: 'token',
      email: req.body.email,
      isAdmin: true

In Chrome inspector the console log is outputted, but I get errors:

image1096×1042 204 KB

What is this “raven” error? and what is the undefined error trying to tell me?

Are you using Sentry? For the first error you may be missing some configuration keys for the Sentry integration.

Raven.js is the official browser JavaScript client for Sentry.

The second one, Cannot read property 'get' of undefined. That’s pointing to the model hook on one of your routes. You can click on the second row at Class.model (route.js:14) and see which route it is. You may be trying to access a property on sometime that could be undefined. You can paste that route file here and we can take a look.