Skip to content

Instantly share code, notes, and snippets.

@LeeDDHH
Last active December 22, 2021 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeeDDHH/5d786d42a05f801d370da3f71f3b69f6 to your computer and use it in GitHub Desktop.
Save LeeDDHH/5d786d42a05f801d370da3f71f3b69f6 to your computer and use it in GitHub Desktop.
nodejsで遭遇したエラーと対処法について

Cannot convert object to primitive value

  • console.logなどの出力メソッドに、オブジェクトをそのまま渡すとエラーが表示される

対処法

  • JSON形式の文字列にして渡す
    • console.log(JSON.stringify(someObject));

Refused to apply inline style because it violates the following Content Security Policy directive

対処法

  • content_security_policyに以下を追加する
    • "default-src 'self' style-src 'self' 'unsafe-inline';"

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment