-
Notifications
You must be signed in to change notification settings - Fork 86
Plugin load if next
is not available
#8
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
Labels
Comments
fair enough, happy to add this! but also would be very confused if a next app didnt have |
This is reported on Bugsnag as well. |
Related to #25 |
Closed
See also #25 (comment) |
Fixed by #45 |
serhalp
pushed a commit
that referenced
this issue
Apr 5, 2024
feat: use none bundler and node_modules created at build time
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
next-on-netlify
requiresnext
as a peerDependency:https://github.com/netlify/next-on-netlify/blob/7d1fd5e08969455035bf9918a6fb2d707984c4a1/package.json#L37-L39
This repository requires
next-on-netlify
as a production dependency:https://github.com/netlify/netlify-plugin-nextjs/blob/ef4529016ed0f87ae89d5f312dc8f8f08d1ef7b6/package.json#L24-L29
If a site is using this plugin, but forgot to install
next
, this plugin will thrown when beingrequire()
'd, as opposed to whenonPreBuild
is run. This results in an error message which might be confusing:To fix this:
next
andnext-on-netlify
should berequire()'d
only inside theif (isNextProject) { ... }
block_isNextProject()
should try torequire('next')
, and returnfalse
if that throws an errorWe might want to also wonder: are we ok with this plugin requiring users to install Next.js as a dependency (as opposed to doing it for them)?
The text was updated successfully, but these errors were encountered: