Remixプロジェクトが、apps/*
に存在する状態で、Docusaurusプロジェクトをapps/*
に作成しました。
その際に、npm run start
を実行したところ、Compiles with problems:
というエラーが発生しました。
Compiled with problems:
×
ERROR
pathname.match is not a function
TypeError: pathname.match is not a function
次に、npm run build
を実行したところ、次のように表示されました。
[ERROR] Docusaurus server-side rendering could not render static page with path /404.html.
...
TypeError: pathname.match is not a function
at Array.some (<anonymous>)
at Array.map (<anonymous>)
...
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.
...
この問題は、次の手順を実行することで解決しました。
- すべてのワークスペースの
node_modules
を削除する。 - ルートディレクトリの
package-lock.json
を削除する - ルートディレクトリにて、
npm install
を実行する。
結果、npm run start
とnpm run build
の実行に成功しました。