LoginSignup
6
5

More than 3 years have passed since last update.

Electron && React のconsole error対応メモ

Last updated at Posted at 2019-11-30

Electron

Electron Security Warning

Node.js Integration with Remote Content

Electron Security Warning (Node.js Integration with Remote Content) This renderer process has Node.js integration enabled
    and attempted to load remote content from 'http://localhost:3000/'. This
    exposes users of this app to severe security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
 This warning will not show up
once the app is packaged.

electron上で、http経由のコンテンツを読み込んだ時に発生。
デバック中は、local上でReactを動かしているので発生する。
パッケージ化すれば発生しないエラー。

process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = '1';

を、 electron.js にて追記すれば表示されなくなる。

[参考]
- Security, Native Capabilities, and Your Responsibility | Electron
- Electron Security Warning (Node.js Integration with Remote Content) · Issue #213 · maximegris/angular-electron

Insecure Resources

/.../node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/renderer/security-warnings.js:95 Electron Security Warning (Insecure Resources) This renderer process loads resources using insecure
  protocols.This exposes users of this app to unnecessary security risks.
  Consider loading the following resources over HTTPS or FTPS. 
 - http://localhost:3000/static/js/bundle.js
- http://localhost:3000/static/js/0.chunk.js
- http://localhost:3000/static/js/main.chunk.js


For more information and help, consult
https://electronjs.org/docs/tutorial/security.
 This warning will not show up
once the app is packaged.

同上

Insecure Content-Security-Policy

Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
    Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
 This warning will not show up
once the app is packaged.

同上

React

semantic ui

table

Warning: validateDOMNesting(...): <th> cannot appear as a child of <thead>.
<Table.Header>
  <Table.Row> <- 抜けてたw
    <Table.HeaderCell>

[参考]
- Table - Semantic UI React

CORS

Access to fetch at 'https://...' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5