Skip to content

Commit

Permalink
fixed: Add prefix to RefreshRuntime path
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanmaaren committed Feb 28, 2023
1 parent 0a7ede9 commit 678c4ab
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ https://vitejs.dev/guide/backend-integration.html#backend-integration
- Run the dev server: `yarn dev`
- View `localhost:8000`
- Now change text in App.tsx

## Update: fixed

This was fixed by updating the RefreshRuntime path:
https://github.com/vitejs/vite-plugin-react/issues/101
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"scripts": {
"dev": "vite",
"mock-server": "cd some-other-server && python3 -m http.server 8000"
"backend-mock": "cd some-other-server && python3 -m http.server 8000"
},
"browserslist": ">0.5%",
"dependencies": {
Expand All @@ -10,13 +10,13 @@
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/react": "18.0.27",
"@types/react-dom": "18.0.10",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/vite-plugin-react-svg": "^0.2.2",
"@vitejs/plugin-react": "3.1.0",
"typescript": "4.9.5",
"vite": "4.1.1",
"vite-plugin-checker": "0.5.5",
"vite": "4.1.4",
"vite-plugin-checker": "0.5.6",
"vite-plugin-svgr": "2.4.0",
"vite-tsconfig-paths": "4.0.5"
},
Expand Down
2 changes: 1 addition & 1 deletion some-other-server/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div>After</div>

<script type="module">
import RefreshRuntime from "http://localhost:8080/@react-refresh";
import RefreshRuntime from "http://localhost:8080/dev_static/@react-refresh";
RefreshRuntime.injectIntoGlobalHook(window);
window.$RefreshReg$ = () => {};
window.$RefreshSig$ = () => (type) => type;
Expand Down
35 changes: 22 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,14 @@
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==

"@types/react-dom@18.0.10":
version "18.0.10"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.10.tgz#3b66dec56aa0f16a6cc26da9e9ca96c35c0b4352"
integrity sha512-E42GW/JA4Qv15wQdqJq8DL4JhNpB3prJgjgapN3qJT9K2zO5IIAQh4VXvCEDupoqAwnz0cY4RlXeC/ajX5SFHg==
"@types/react-dom@18.0.11":
version "18.0.11"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.11.tgz#321351c1459bc9ca3d216aefc8a167beec334e33"
integrity sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@18.0.27":
"@types/react@*":
version "18.0.27"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.27.tgz#d9425abe187a00f8a5ec182b010d4fd9da703b71"
integrity sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA==
Expand All @@ -518,6 +518,15 @@
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/react@18.0.28":
version "18.0.28"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.28.tgz#accaeb8b86f4908057ad629a26635fe641480065"
integrity sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/scheduler@*":
version "0.16.2"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
Expand Down Expand Up @@ -1504,10 +1513,10 @@ update-browserslist-db@^1.0.10:
escalade "^3.1.1"
picocolors "^1.0.0"

vite-plugin-checker@0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/vite-plugin-checker/-/vite-plugin-checker-0.5.5.tgz#164159c129231e9d23507735f5b1cdce5fbda8da"
integrity sha512-BLaRlBmiVn3Fg/wR9A0+YNwgXVteFJaH8rCIiIgYQcQ50jc3oVe2m8i0xxG5geq36UttNJsAj7DpDelN7/KjOg==
vite-plugin-checker@0.5.6:
version "0.5.6"
resolved "https://registry.yarnpkg.com/vite-plugin-checker/-/vite-plugin-checker-0.5.6.tgz#233978091dfadef0873f0a8aacfe7fc431212b95"
integrity sha512-ftRyON0gORUHDxcDt2BErmsikKSkfvl1i2DoP6Jt2zDO9InfvM6tqO1RkXhSjkaXEhKPea6YOnhFaZxW3BzudQ==
dependencies:
"@babel/code-frame" "^7.12.13"
ansi-escapes "^4.3.0"
Expand Down Expand Up @@ -1543,10 +1552,10 @@ vite-tsconfig-paths@4.0.5:
globrex "^0.1.2"
tsconfck "^2.0.1"

vite@4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.1.1.tgz#3b18b81a4e85ce3df5cbdbf4c687d93ebf402e6b"
integrity sha512-LM9WWea8vsxhr782r9ntg+bhSFS06FJgCvvB0+8hf8UWtvaiDagKYWXndjfX6kGl74keHJUcpzrQliDXZlF5yg==
vite@4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.1.4.tgz#170d93bcff97e0ebc09764c053eebe130bfe6ca0"
integrity sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==
dependencies:
esbuild "^0.16.14"
postcss "^8.4.21"
Expand Down

0 comments on commit 678c4ab

Please sign in to comment.