Neutrinojs的React项目在控制台中显示“无效的主机/原始标题”

时间:2018-12-23 18:53:43

标签: javascript webpack neutrino

当我创建Neutrinojs v.9项目时

Davids-iMac-Pro:repos davidedelhart$ create-project test-n9

...     欢迎来到中微子!     为了帮助您创建新项目,我将问您几个问题。

?   First up, what would you like to create? A web or Node.js application
?   Next, what kind of application would you like to create? React
?   Would you like to add a test runner to your project? Jest
?   Would you like to add linting to your project? Airbnb style rules

  Looks like I have all the info I need. Give me a moment while I create your project!

   create test-n9/package.json
   create test-n9/.neutrinorc.js
   create test-n9/webpack.config.js
   create test-n9/src/App.css
   create test-n9/src/App.jsx
   create test-n9/src/index.jsx
   create test-n9/jest.config.js
   create test-n9/test/simple_test.js
   create test-n9/.eslintrc.js

...

Now change your directory to the following to get started:
  cd test-n9

❤️  Neutrino
Davids-iMac-Pro:repos davidedelhart$ cd test-n9/
Davids-iMac-Pro:test-n9 davidedelhart$ yarn 
yarn install v1.12.3
warning ../../../package.json: No license field
[1/4]   Resolving packages...
success Already up-to-date.
✨  Done in 0.41s.
Davids-iMac-Pro:test-n9 davidedelhart$ yarn start
yarn run v1.12.3
warning ../../../package.json: No license field
$ webpack-dev-server --mode development --open
ℹ 「wds」: Project is running at http://localhost:5000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to /index.html
ℹ 「wdm」: wait until bundle finished: /
ℹ 「wdm」: Time: 1814ms
ℹ 「wdm」: Compiled successfully.

我反复收到“主机/来源标头”断开连接的消息:

error stack from chrome debugger

这是什么来的,要消失它需要什么?

谢谢

1 个答案:

答案 0 :(得分:0)

同样的错误也出现在角度上。我知道如何处理角度问题,但我不知道如何反应。我仍然对此做了一些RND,我明白了。

public partial class EllipseFillPage : ContentPage
{
    public EllipseFillPage()
    {
        InitializeComponent();
    }

    void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
    {
        SKImageInfo info = args.Info;
        SKSurface surface = args.Surface;
        SKCanvas canvas = surface.Canvas;

        canvas.Clear();

        float strokeWidth = 5;
        float xRadius = (info.Width - strokeWidth) / 3;
        float yRadius = (info.Height - strokeWidth) / 3;

        SKPaint paint = new SKPaint
        {
            Style = SKPaintStyle.Stroke,
            Color = SKColors.Black,
            StrokeWidth = strokeWidth
        };
        canvas.DrawOval(info.Width / 2, info.Height / 2, xRadius, yRadius, paint);
    }
}

然后重新启动开发服务器。

有关更多信息,link

我希望它可以对您有所帮助。