This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
fix: don't fail if critters is missing on Next.js>=10.0.4 #295
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ehmicky
reviewed
Jan 11, 2021
src/node_dependencies/nested.js
Outdated
@@ -60,4 +65,17 @@ const isOptionalModule = function ( | |||
) | |||
} | |||
|
|||
// 'critters' is used only in Next.js >= 10.0.4 when enabling an experimental option and has to be installed manually | |||
// we ignore it if it's missing | |||
const isExternalModule = function (moduleName, { dependencies = {}, devDependencies = {} }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we abstract this by taking the module names and versions from some constant variable such as:
const EXTERNAL_MODULES = {
critters: { next: '>= 10.0.4' }
}
This would allow adding more of those.
Alternatively we could also wait for another case of external module to abstract, but then maybe we should rename isExternalModule()
to isExternalCrittersModule()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we could also wait for another case of external module to abstract
Let's wait for another use case.
Not sure we want this to be a long term fix anyway.
ehmicky
approved these changes
Jan 11, 2021
This was referenced Jan 11, 2021
neefrehman
added a commit
to neefrehman/allergies.travel
that referenced
this pull request
Jan 12, 2021
fixed in netlify/next plugin: netlify/zip-it-and-ship-it#295
einSelbst
added a commit
to einSelbst/overnext
that referenced
this pull request
Mar 9, 2021
einSelbst
added a commit
to einSelbst/overnext
that referenced
this pull request
Mar 9, 2021
Skn0tt
pushed a commit
to netlify/build
that referenced
this pull request
May 21, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- Summary
Related to netlify/next-on-netlify#103 (comment)
Doesn't fix the original issue as the original issue is about a missing
react-native
module (we don't have a reproduction for it).This is a result of a recent change in Next.js
Note: This use case is not covered by the logic that makes
zip-it-and-ship-it/tests/main.js
Line 127 in 1e248c6
Next.js
dependencies instead of copying published files, side files and nested modules.A better solution would be to support configuring external modules (see #68) so the Next.js plugin (or any other plugin) can generate a relevant bundling configuration based on the framework.
That bundling configuration can change based on the site configuration, for example if the user has
optimizeCss
configured for their Next.js site, we would like to bundle thecritter
dependency.Regardless, this is an issue with Next.js as
critters
should be an optional dependency.- Test plan
Added unit tests
- Description for the changelog
Don't fail when
critters
module is missing onNext.js>=10.0.4
- A picture of a cute animal (not mandatory but encouraged)
![image](https://user-images.githubusercontent.com/26760571/104046817-53cb6300-51e9-11eb-97c7-606b8c86d7c8.png)