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: docs/guide/troubleshooting.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,18 @@ An example of cross drive links are:
287
287
288
288
Related issue: [#10802](https://github.com/vitejs/vite/issues/10802)
289
289
290
+
### Default import unexpectedly returns an object
291
+
292
+
The default import returns the `module.exports` object for CJS modules, while you may expect it to return the `module.exports.default` value.
293
+
294
+
This may cause errors like:
295
+
296
+
> Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
297
+
298
+
> foo is not a function
299
+
300
+
See Rolldown's docs about this problem for more details: [Ambiguous `default` import from CJS modules - Bundling CJS | Rolldown](https://rolldown.rs/in-depth/bundling-cjs#ambiguous-default-import-from-cjs-modules).
301
+
290
302
<scriptsetuplang="ts">
291
303
// redirect old links with hash to old version docs
0 commit comments