Changing to esmodule causes _document.js to throw an error
Unanswered
Vespid wasp posted this in #help-forum
Vespid waspOP
Hello im trying to update my project to use esmodule by updating my package.json to use
what change am i missing to apply to make it work?
Note that I am using Nextjs 14
Here is the link of someone having the same issue as I am
https://forum.freecodecamp.org/t/configuring-next-config-js-to-implement-image-tag/625444
"type":"module"
and changing the next.config.js
to next.config.mjs
but im encountering issue when running the app where I keep getting this error in my _document.js
fileTypeError: Class extends value #<Object> is not a constructor or null
export default class MyDocument extends Document {
what change am i missing to apply to make it work?
Note that I am using Nextjs 14
Here is the link of someone having the same issue as I am
https://forum.freecodecamp.org/t/configuring-next-config-js-to-implement-image-tag/625444
1 Reply
Vespid waspOP
for reference of my _document.js file
https://medium.com/zestgeek/how-to-set-up-styled-components-with-next-js-14-51f7baf3e627
https://medium.com/zestgeek/how-to-set-up-styled-components-with-next-js-14-51f7baf3e627