I believe this is related to #926.
All modules get absolute paths except styled-jsx.
For example in .next/dist/pages/_error.js.
You can try this with the custom-server example by going to a 404 route. /example for example.
Error: Cannot find module 'styled-jsx/style'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> .next/dist/pages/_error.js:27:14)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3) code: 'MODULE_NOT_FOUND' }
Found the issue. Creating a PR now.
Okay. Here's what's happening is pretty interesting.
styled-jsx/babel add the import statement of styled-jsx/style
Since we don't transpile ES2015 modules, styled-jsx/style won't get resolved via babel.
(But it happens earlier)
Let's see what we can do.
How does one access this fix? Using next 3.0.3 I am still getting this error. Let me know if you need any more info from me.
Haha yep found it yesterday! Got it allll working now. Thank you!
On Oct 11, 2017, at 2:18 AM, Johan Meester notifications@github.com wrote:
Possibly related https://github.com/zeit/styled-jsx/issues/302?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/zeit/next.js/issues/951#issuecomment-335748844, or mute the thread https://github.com/notifications/unsubscribe-auth/AK7rpXs3xV-X1QIkvsbwHu1OmtuvLgNVks5srIfbgaJpZM4L0eT8.
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
How does one access this fix? Using next 3.0.3 I am still getting this error. Let me know if you need any more info from me.