import next from 'next' with getServerSideProps will break once deployed on Vercel #35873
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Reproduction: https://github.com/vercel-support/76289-nextjs-getServerSideProps
When you have a page that uses
getServerSideProps
(SSR) and import a component that hasimport next from 'next'
, the page will cause a 500 error when deployed on Vercel.In error log you will see
Cannot find module '/var/task/node_modules/next/dist/server/next.js'
.Problem will not affect pages that use
getStaticProps
or if you removeimport next from 'next'
.Problem only occurs after deploying to Vercel, works fine in localhost.
Expected Behavior
Ideally,
import next from 'next'
can be ignored when running SSR, or a better error message can be considered.To Reproduce
Reproduction: https://github.com/vercel-support/76289-nextjs-getServerSideProps.
See
/components/chip.js' and
/pages/index.js`.The text was updated successfully, but these errors were encountered: