I was trying the webpack alias suggestion, hoping it would fix the Next.js Duplicate declaration "_JSXStyle" error as reported here and there when I ran into another issue:
This dependency was not found in node_modules:
* styled-jsx/server
The above happens after I add this custom next.config.js:
The file is there but I guess it's being imported without explicitly using the .js extension. I don't know if it's the example or the code that needs changing. I think less config is better. But then maybe there is something wrong with my defaults. I see example of React components being imported without explicit extension, whereas I've so far had to spell out the exact filepaths for components local to a project.
Anyway, I don't quite understand what this alias does. The Next.js example doesn't have it, and it seems <style jsx> is to be used all the same either way.
I was trying the webpack alias suggestion, hoping it would fix the Next.js
Duplicate declaration "_JSXStyle"
error as reported here and there when I ran into another issue:The above happens after I add this custom
next.config.js
:Adding the following to the config fixes it:
The file is there but I guess it's being imported without explicitly using the
.js
extension. I don't know if it's the example or the code that needs changing. I think less config is better. But then maybe there is something wrong with my defaults. I see example of React components being imported without explicit extension, whereas I've so far had to spell out the exact filepaths for components local to a project.Anyway, I don't quite understand what this alias does. The Next.js example doesn't have it, and it seems
<style jsx>
is to be used all the same either way.