Featured image of post nodejs+expressのjadeでエラーを回避する

nodejs+expressのjadeでエラーを回避する

Twitter ツイート Hatena Bookmark ブックマーク

[email protected][email protected]の組み合わせで久しぶりにツールを作ろうと思ったんですが、なぜかしらないけど500エラーが・・・
単純expressのデフォルトでhello world出そうと思っただけなんですけどね。

エラーメッセージは以下のようになっています。

1
500 Error: /var/www/test/nodejs/acs/views/index.jade:5<br /> 3| block content<br /> 4| h1= title<br /> > 5| p Welcome to "test"<br /><br />`doctype 5` is deprecated, you must now use `doctype html`

これをみるとdoctype 5ってのが単純にだめみたい。
どうやらviews/layout.jadeのなかに記載されているdoctype宣言がおかしいと。

で、layout.jadeの中身は以下のようになっています。

1
2
3
4
5
6
7
doctype 5
html(lang="ja")
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    block content

まあエラーメッセージに
「`doctype 5` is deprecated, you must now use `doctype html`」
ってかいてありますよね。

ってこは単純にdoctype 5はdeprecatedなわけで、doctype htmlって書き換えればいいわけですよ。
そう、こんな感じにね。

1
2
3
4
5
6
7
doctype html
html(lang="ja")
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    block content

これexpressにpull requestでもおくったほうがいいのかなぁ。

comments powered by Disqus
Built with Hugo
テーマ StackJimmy によって設計されています。