Open8

Remix を React router v7 に移行

Ryosuke MiyamotoRyosuke Miyamoto

codemodを実行する(自動化)

npx codemod remix/2/react-router/upgrade

をしたが、以下の点を手動で対応

Ryosuke MiyamotoRyosuke Miyamoto

npm i'@react-router/css-bundle@^7.0.0' is not in this registry. になってしまったので、
"@react-router/css-bundle": "^7.0.0" を削除。

react-router/css-bundle なくてもいいのかは、ちゃんと調べてないけど、dev は動いた。

Ryosuke MiyamotoRyosuke Miyamoto

npx npm-check-updates で諸々 latest に

"@react-router/node": "^7.1.1",
"@react-router/serve": "^7.1.1",
"react-router": "^7.1.1",
"react-router-dom": "^7.1.1",
"@react-router/dev": "^7.1.1",
Ryosuke MiyamotoRyosuke Miyamoto

以下の @sentry/remix のエラーが出たが、おそらくまだ sentry に React Router v7 のフレームワーク版?が対応されてないので、一旦ここまで。

[vite] Internal server error: Failed to resolve entry for package "@sentry/remix". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@sentry/remix" package

https://github.com/getsentry/sentry-javascript/issues/14519