2017-03-11 6 views
0

私のスタックreact/redux/redux-observable/immutablejs。 クライアントは、サーバーサイドレンダリングを使用してfeathers.jsによってレンダリングされます。 私はfeather-clientを使用して、400を取得した後(要求は検証をパスしません)。 私は.json形式の応答を得ました。しかし、何らかの理由で、HTMLまたは文字列に変換されます。クライアント側のフェザーエラー

Error: Order validation failed 
    at BadRequest.ExtendableBuiltin (bundle.js:106696) 
    at BadRequest.FeathersError (bundle.js:106771) 
    at new BadRequest (bundle.js:106812) 
    at convert (bundle.js:107040) 
    at toError (bundle.js:106043) 

クライアントで無効にする方法はありますか。

import 'isomorphic-fetch'; 
import feathers from 'feathers-client'; 
import authentication from 'feathers-authentication-client'; 
import config from './config'; 

let storage = null; 
if (!process.env.BROWSER && process.NODE_ENV !== 'test') { 
    require('localstorage-polyfill'); 
    storage = global.localStorage; 
}else{ 
    storage = window.localStorage; 
} 

const port = process.env.PORT || config.port; 

promise.polyfill(); 

const rest = feathers.rest(`http://localhost:${port}/api`); 
const app = feathers() 
    .configure(feathers.hooks()) 
    .configure(rest.fetch(require('isomorphic-fetch'))) 
    .configure(authentication({ storage })); 

export default app; 

答えて

0

https://github.com/feathersjs(クライアント上に[羽-エラー]を取得し、うん

+0

...それは単に.toJSON()メソッドを実装しています、それを固定し、いくつかの分を過ごします/ feathers-errors)エラーです。 JavaScript [エラーオブジェクト](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)は、通常のオブジェクトのようにコンソールにログオンしません。それでも、すべてのプロパティにアクセスできますが、 'console.log'には表示されません。もしそれを '.toJSON'に記録したいのであれば、行く方法です。 – Daff

関連する問題