You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/troubleshooting.md
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,45 @@ The error may also occur if the browser extensions (like ad-blockers) are blocki
189
189
190
190
It might be possible to work around by selecting a different chunk name by [`build.rollupOptions.output.chunkFileNames`](../config/build-options.md#build-rollupoptions), as these extensions often block requests based on file names (e.g. names containing `ad`, `track`).
191
191
192
+
### `Failed to fetch dynamically imported module` error
193
+
194
+
> TypeError: Failed to fetch dynamically imported module
195
+
196
+
This error occurs in several cases:
197
+
198
+
- Version skew
199
+
- Poor network conditions
200
+
- Browser extensions blocking requests
201
+
202
+
#### Version skew
203
+
204
+
When you deploy a new version of your application, the HTML file and the JS files still reference old chunk names that were deleted in the new deployment. This happens when:
205
+
206
+
1. Users have an old version of your app cached in their browser
207
+
2. You deploy a new version with different chunk names (due to code changes)
208
+
3. The cached HTML tries to load chunks that no longer exist
209
+
210
+
If you are using a framework, refer to their documentation first as it may have a built-in solution for this problem.
211
+
212
+
To resolve this, you can:
213
+
214
+
-**Keep old chunks temporarily**: Consider keeping the previous deployment's chunks for a period to allow cached users to transition smoothly.
215
+
-**Use a service worker**: Implement a service worker that will prefetch all the assets and cache them.
216
+
-**Prefetch the dynamic chunks**: Note that this does not help if your HTML file is cached by the browser due to `Cache-Control` headers.
217
+
-**Implement a graceful fallback**: Implement error handling for dynamic imports to reload the page when chunks are missing. See [Load Error Handling](./build.md#load-error-handling) for more details.
218
+
219
+
#### Poor network conditions
220
+
221
+
This error may occur in unstable network environments. For example, when the request fails due to network errors or server downtime.
222
+
223
+
Note that you cannot retry the dynamic import due to browser limitations ([whatwg/html#6768](https://github.com/whatwg/html/issues/6768)).
224
+
225
+
#### Browser extensions blocking requests
226
+
227
+
The error may also occur if the browser extensions (like ad-blockers) are blocking that request.
228
+
229
+
It might be possible to work around by selecting a different chunk name by [`build.rollupOptions.output.chunkFileNames`](../config/build-options.md#build-rollupoptions), as these extensions often block requests based on file names (e.g. names containing `ad`, `track`).
230
+
192
231
## 디펜던시 최적화 {#optimized-dependencies}
193
232
194
233
### 링크된 로컬 패키지의 경우 사전 번들링 된 디펜던시가 갱신되지 않음 {#outdated-pre-bundled-deps-when-linking-to-a-local-package}
@@ -206,7 +245,11 @@ vite --profile --open
206
245
```
207
246
208
247
```bash [빌드]
209
-
vite build --profile
248
+
Some browser extensions (like ad-blockers) may prevent the Vite client from sending requests to the Vite dev server. You may see a white screen without logged errors in this case. You may also see the following error:
249
+
250
+
> TypeError: Failed to fetch dynamically imported module
0 commit comments