Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styled-jsx module not found #951

Closed
timneutkens opened this issue Feb 1, 2017 · 6 comments
Closed

Styled-jsx module not found #951

timneutkens opened this issue Feb 1, 2017 · 6 comments
Assignees

Comments

@timneutkens
Copy link
Member

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' }
@timneutkens timneutkens changed the title Tree shaking: styled-jsx is not loaded Styled-jsx module not found Feb 1, 2017
@timneutkens
Copy link
Member Author

Found the issue. Creating a PR now.

@arunoda
Copy link
Contributor

arunoda commented Feb 2, 2017

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.

@thetoxicavenger
Copy link

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.

@JohnMostlyR
Copy link

Possibly related?

@thetoxicavenger
Copy link

thetoxicavenger commented Oct 11, 2017 via email

@lock
Copy link

lock bot commented May 10, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants