Open edlerd opened 1 week ago
We can not declare fs
as a dependency, as it is a nodejs module.
You have two options:
This stack overflow answer should give you all the details and code snippets you need: https://stackoverflow.com/a/68098547
Rollup users might want to use this plugin: nodeResolve({ browser: true, preferBuiltins: false })
Thanks for the suggestions, they didn't resolve the issue for me. But I found a workaround with the info you provided:
Moving all data loading into getServerSideProps
lets the build pass with contentful 11. Previously I was doing that in getInitialProps
, which seems to be unsupported since the update.
Building a nextjs application after upgrade of contentful from 10.15.1 to 11.0.2 fails due to the below message
After downgrade to 10.15.1 the build is passing. I would like to upgrade, but how to make the build pass? Are you missing to declare the dependency to fs?
Happy to provide more info if needed.