小编kli*_*kub的帖子

EventSource 的响应具有不是“text/event-stream”的 MIME 类型(“text/html”)。中止连接

我已经阅读了很多有关此错误的信息,但找不到解决方案。

热重载不起作用,我有一个错误:

EventSource 的响应具有不是“text/event-stream”的 MIME 类型(“text/html”)。中止连接。

"webpack": "^2.5.1",
"webpack-dev-middleware": "^1.8.4",
"webpack-hot-middleware": "^2.22.1",
Run Code Online (Sandbox Code Playgroud)

我找到了https://github.com/webpack-contrib/webpack-hot-middleware/issues/26但这对我没有帮助

你知道如何摆脱这个错误吗?

我的 webpack.config.js

const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const project = require('../project.config')

const inProject = path.resolve.bind(path, project.basePath)
const inProjectSrc = (file) => inProject(project.srcDir, file)

const __DEV__ = project.env === 'development'
const __TEST__ = project.env === 'test'
const __PROD__ = project.env === 'production'

const config = {
  entry: {
    normalize: [
      inProjectSrc('normalize'),
    ],
    main: [ …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs webpack webpack-dev-server webpack-hmr

8
推荐指数
0
解决办法
2281
查看次数

向上滑动面板 - google mapfragment下的细线滑动面板

我使用这个存储库制作了slidinguppanel https://github.com/dlukashev/AndroidSlidingUpPanel-foursquare-map-demo

但是,它包含一个未在任何地方覆盖的错误.

当我触摸任何地方扩展面板(listview)效果很好,但是当我试图通过按住列表视图的顶部(屏幕2上的蓝线)来展开它时,面板隐藏在地图下(framelayout)(screen3)

怎么有可能这个蓝线隐藏面板在mapfragment和listview的其余部分扩展得很好?

有什么想法吗?请给我一个提示如何修复它?

请看屏幕:

http://i.stack.imgur.com/G88Ok.jpg

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <org.sothree.slidinguppanel.SlidingUpPanelLayout
        android:id="@+id/slidingLayout"
        android:gravity="bottom"
        app:shadowHeight="0dp"
        app:paralaxOffset="@dimen/paralax_offset"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <FrameLayout
            android:gravity="top"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_below="@+id/button">

            <RelativeLayout
                android:id="@+id/mapContainer"
                android:layout_width="fill_parent"
                android:layout_height="497dp"/>
        </FrameLayout>

        <RelativeLayout
            android:id="@+id/slidingContainer"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_below="@+id/button">

            <View
                android:id="@+id/transparentView"
                android:visibility="gone"
                android:layout_width="fill_parent"
                android:layout_height="@dimen/map_height"
                android:layout_alignParentTop="true"/>

            <ListView
                android:id="@+id/listView1"
                android:cacheColorHint="@android:color/white"
                android:drawSelectorOnTop="true"
                android:dividerHeight="@dimen/divider_height"
                android:divider="@android:color/darker_gray"
                android:background="@android:color/transparent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_below="@id/transparentView"
                android:smoothScrollbar="true"
                android:layout_marginTop="0dp"/>

        </RelativeLayout>

    </org.sothree.slidinguppanel.SlidingUpPanelLayout>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android slidingmenu slidingpanelayout android-framelayout

5
推荐指数
1
解决办法
2365
查看次数

Gatsby 博客 - 每篇新文章都需要在构建后硬刷新

我有 gatsby 博客,在我创建新帖子并构建静态文件后,将它们上传到我的主机上,每个用户都必须在我的博客上进行硬刷新才能看到更改。

上传新版本后如何在下次访问时自动刷新?

hosting blogs reactjs gatsby

4
推荐指数
1
解决办法
1579
查看次数

React-table - 禁用一列的全局过滤器,但为禁用的一列添加另一个过滤器

是否可以禁用一列的全局过滤器,但为禁用的列添加另一个过滤器react-table?就像是:

在此输入图像描述

reactjs react-table

4
推荐指数
1
解决办法
1763
查看次数

如何检测照片是否拍摄(相机意图)

我想发送相机意图拍摄的照片.

  • 相机工作正常
  • 我有来自mMediaUri.getPath()的路径(这是正确的)
  • 我有发送它的方法(postImage())(工作正常)

当我启动一个Intent时,相机正在显示,但方法postImage不会等到拍照.PostImage只是在启动意图后加载.

如何在拍照后加载postImage?

要么

如何检测照片是否拍摄?

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
        mMediaUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
        if(mMediaUri == null){
          Toast.makeText(MainActivity.this, "Problem!", Toast.LENGTH_LONG).show();

        }
        else {
            takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mMediaUri);
            startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);

            postImage("mail", mMediaUri.getPath());

        }

    }
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

android android-intent android-camera android-camera-intent

3
推荐指数
1
解决办法
2050
查看次数

React-router-dom v4,在NavBar中进行链接,但在App.js中进行路由

我对react-router-dom v4有问题

当我单击App.js中的“主页/联系人”链接时,它运行良好,请重定向到正确的路径。

但是,当我单击NavBar链接(NavLink =“ =”)时,它会更改路径,但不会呈现新组件

如何强制NavLink单击以重新呈现新组件?

App.js

export const App = () => {
return(
  <div className="App">
    <NavBar />
    <div className='text-center'>
        <div className='children'>
          <Router>
            <div className="container">
              <Link to="/">Home</Link>
              <Link to= "/contact">Contact</Link>
              <Link to= "/terms">Terms</Link>
              <Route exact path= "/" component={Home} />
              <Route path= "/contact" component={Contact} />
              <Route path= "/terms" component={Terms} />
            </div>
          </Router>
        </div>

        <Footer />

    </div>
  </div>
);}
export default App;
Run Code Online (Sandbox Code Playgroud)

NavBar.js

class NavBar extends React.Component {
render () {
return (
  <nav className="navbar navbar-default horizontal-navbar">
          <a className="navbar-brand" href="#"> …
Run Code Online (Sandbox Code Playgroud)

javascript routing url-routing reactjs react-router

2
推荐指数
1
解决办法
4236
查看次数