# ユーザー名&メールアドレスを変更した際にローカル環境を正常に立ち上げられなくなった!!

どこのブランチに移動してもブラウザが正常に表示されない問題が...  
しかもこれは正常に表示されたりされなかったり。
直ったと思ったらまた出てくる...。
エラーはこんな感じ...
## Chrome
![Screen Shot 2020-10-01 at 13.26.15.png](/attachment/5f75ba08260d9b0049be1983)
```
Refused to execute script from 'http://localhost:3000/styles/style-app.bundle.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
```
```
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
Because a cookie's SameSite attribute was not set or is invalid, it defaults to SameSite=Lax, which prevents the cookie from being sent in a cross-site request. This behavior protects user data from accidentally leaking to third parties and cross-site request forgery.
Resolve this issue by updating the attributes of the cookie:
Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use.
Specify SameSite=Strict or SameSite=Lax if the cookie should not be sent in cross-site requests
```


## Firefox
```Cookie "connect.sid" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 login
Cookie "connect.sid" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 login
Cookie "connect.sid" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 2 login
Cookie "io" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 2 socket.io
Cookie "io" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 2 socket.io
Cookie "connect.sid" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 login
Cookie "connect.sid" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 login
Cookie "io" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 2 socket.io
Cookie "io" は "secure" 属性なしで "SameSite" 属性に "none" または不正な値が設定されているため、まもなく拒否されます。"SameSite" 属性についての詳細は https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite をお読みください。 2 socket.io
MIME タイプ ("text/html") の不一致により "http://localhost:3000/login" からのリソースがブロックされました (X-Content-Type-Options: nosniff)。
login
<script> のソース "http://localhost:3000/styles/style-app.bundle.js" の読み込みに失敗しました。 login:120:1
MIME タイプ ("text/html") の不一致により "http://localhost:3000/login" からのリソースがブロックされました (X-Content-Type-Options: nosniff)。
login
MIME タイプ ("text/html") の不一致により "http://localhost:3000/login" からのリソースがブロックされました (X-Content-Type-Options: nosniff)。
login
<script> のソース "http://localhost:3000/styles/theme-nature.bundle.js" の読み込みに失敗しました。
```


## やったこと
1. devContainerでrebuildしてみる
1 VScode上のターミナルをみると、
1. **configの許可がないよー**という旨のエラーが出る(エラーをメモするの忘れました...)
1. `git config -l --global`コマンドをうち、usernameとemailを確認
    - 私の場合、古いままだったのでブラウザのアクセス権限がなかった模様

[開発環境の構築](https://docs.growi.org/ja/dev/startup-v2/dev-env.html)
```
git config --global user.name "Your Name"
git config --global user.email "yourname@example.com"
```
↑これで再度設定。

#### 補足
上記はターミナル上でやって変更できた
しかし、VScode上のターミナルで`git config -l --global`を打つとなぜか権限が与えられていない旨のエラーが出る

```
node ➜ /workspace/growi () $ git config --global user.name "kaori"
warning: unable to access '.git/config': Operation not permitted
warning: unable to access '.git/config': Operation not permitted
fatal: unknown error occurred while reading the configuration files
warning: unable to access '.git/config': Operation not permitted
warning: unable to access '.git/config': Operation not permitted
```

そこで、gitのコマンドではなく、vimのコマンドでファイルの中身を参照(`vi config`)すると、
直接中身を書き換えることができた。(vimの操作には注意)
#### vimメモ
```
x: 一文字消す
q!: vimから脱出する。
```
gitコマンドでは書き換えられなかったが、vimでは変更できた。(これの理由は謎)


1. ユーザー名とメールアドレスが変更できたか確認できたら、いつも通りyarn, yarn build, yarn serverする

これでできた！
(今後エラーが再現しなければのお話)

### まとめ
- css ファイルへのアクセス権限がなかったからブラウザも正常に表示されなかったみたい

- 他のブランチにうつってdevContainer上で、`git config -l --global`をしたら、usernameとmail adlessが昔のままの時がある。
その時は、再度
```
git config --global user.name "Your Name"
git config --global user.email "yourname@example.com"
```
で新しいものに書き換えましょう。


### yusuketkがサポートしてくれた

![Screen Shot 2020-10-01 at 20.35.47.png](/attachment/5f75bf2f260d9b0049be198e)


---

## Page Navigation

- Canonical URL: https://tips.weseek.co.jp/ユーザー名&メールアドレスを変更した際の注意点
- Permalink: https://tips.weseek.co.jp/5f75b9d1260d9b0049be197f
- Parent: [/](/5e37dfdaf1262a0048012d51.md)
- Children: 0 total
- Total descendants: 0
- Siblings: 14 total
  - [GROWI](/5e393927e848c600487d6a01.md)
  - [Linuxでエイリアスを設定する方法](/5f7db291661a570048d6ed48.md)
  - [Macでnodeのバージョン切り替えnodebrew の使い方](/5f7d919b661a570048d6ed45.md)
  - [SLOとSLA](/5e5530aaf5678a00487dbf8d.md)
  - [Sandbox](/5e37dfdaf1262a0048012d50.md)
  - [Sass](/5e39859be848c600487d6a32.md)
  - [Sidebar](/696dabca3ac594bd1e386830.md)
  - [Tips](/5e44f1546857420048c06de8.md)
  - [URLエンコードとは何か](/5ec1158a98091d00481e2b5d.md)
  - [WSもくもく会](/5f000f8529b73000484dddad.md)
  - [user](/65069da24603e7ff39a6b3d1.md)
  - [今日のレビューから](/5e38deb8e848c600487d69a0.md)
  - [用語集](/5e392c4be848c600487d69c9.md)
  - [開発日記](/5e3d294bcff797004b16abba.md)
- Last updated: 2020-10-06T10:19:00.624Z by deleted_at_1672138409189
- Full page listing (all children regardless of count): https://tips.weseek.co.jp/_api/v3/page-listing/children?id=5f75b9d1260d9b0049be197f
