-
-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When using preact/debug as recommmended in the Preact readme, async routes cause the following warning to appear in the browser console:
Undefined component passed to preact.h()
<undefined path="/" url="/" matches="[object Object]" /> debug.js:17
The routes still work perfectly fine, but the warning is misleading and confusing.
I'm not sure if this is a bug in preact-cli's async loading strategy or preact itself, but I suspect the former.
If the current behavior is a bug, please provide the steps to reproduce.
preact create default testcd test,npm install- Edit
src/components/app.jsas follows:
import { Router } from 'preact-router';
+if (module.hot) {
+ require('preact/debug');
+}
+
import Header from './header';npm run start, open http://localhost:8080, open console with Ctrl+Shift+K (or your OS and browser's equivalent)- The above warning will appear in the console
What is the expected behavior?
No warning should be shown since everything works as expected
Please mention other relevant information.
- node version 8.9.1
- npm version 5.6.0
- Operating system Windows 10 1709
alvis, NeXidan, tobia and joaocunha
Metadata
Metadata
Assignees
Labels
No labels