When I'm using some dynamic component with SSR: false that is crashing I expect it to see the error somehow.
袗pp is just stuck in "loading..." page state: no page error, no console output, no term output.
// pages/index.js
import dynamic from 'next/dynamic'
const TestLoader = dynamic(import('../components/Test'), { ssr: false})
export default () => <TestLoader />
// components/Test.js
throw new Error('test')
export default () => <div>hello</div>
Some 3rd-party libs are validating the initial options by throwing an error (e.g. Auth0); it makes nearly impossible to debug them
| Tech | Version |
|---------|---------|
| next | 3.2.1 |
| node | 8.4.0 |
| OS | Mac 10.12 |
| browser | Chrome |
This really could post some error notification on bad loading.
Same behaviour with mapbox-gl. Mapbox-GL can't by minified with Uglyfier and must be skiped with webpack noParse. But find this problem takes some time, because in development env it work, in production doesn't. And no error in console :/
Is there a workaround to at least showing the error that is causing a problem? I'm not using mapbox-gl, but I do have non-ssr dynamic imports that are stuck at loading. They load fine in development, but in production they just hang at loading... and nothing ever gets logged.
My issue is caused by trying to dynamically load a component that imports CSS modules. Moving the CSS module to the Page component that was loading the child component resolved my issue, but seeing some kind of error message would have obviously made this much easier.
Here is the cause explained: https://github.com/zeit/next.js/issues/4287
PR is here: https://github.com/zeit/next.js/pull/3897
Looks like this one should be closed too, as long as fix is there.
Sorry everyone for disappearing, my bad.
Most helpful comment
This really could post some error notification on bad loading.
Same behaviour with mapbox-gl. Mapbox-GL can't by minified with Uglyfier and must be skiped with webpack noParse. But find this problem takes some time, because in development env it work, in production doesn't. And no error in console :/