-
Notifications
You must be signed in to change notification settings - Fork 28
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
TypeError: merge.all is not a function #17
Comments
Can you check if https://github.com/octokit/rest.js/issues/1129 helps? |
@gr2m Actually I've found the solution, just add the followings into the webpack configuration file:
It seems that it's an issue introduced by deepmerge, not rest.js Thanks anyway! |
I'd close this issue since it has been solved :) |
Is there something I can do in @octokit/rest so others won’t run into it? |
@gr2m I think I've found the root cause after debugging, here's the explanation:
So the viable solution is either to require the Commonjs Module, or import the ES Module. I think you can simply add a webpack config file into the project
And don't forget to update the |
Just got this after upgrading and making all the required changes. Changing the webpack is not a viable solution since I use create-react-app. Please make the fix on @octokit side instead :) |
I don’t think that adding something to |
Side note: deepmerge readme points to this webpack issue webpack/webpack#6584 |
Maybe you can use a fork with these changes: TehShrike/deepmerge#124 |
@brunolemos Maybe adding the alias is the best workaround for now, and it looks like forward compatible. |
I moved the issue to |
I was able to reproduce the problem, the build files attached to the releases throw the same error: https://github.com/octokit/endpoint.js/releases It would be good to add a test that runs with the built file |
🎉 This issue has been resolved in version 3.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Great job! |
I'm using webpack 4.26.1 with rest.js, but after a successful bundling the application encountered this error
TypeError: merge.all is not a function
.Then I tried the TypeScript compiler, while it works perfect.
I've found the simillar issue(#1129 ), but it doesn't help at all.
Here is the error stack:
After debugging into the package
deepmerge
, I got this:Note that the webpack imports the
deepmerge
from "./node_modules/deepmerge/dist/es.js", which is an ES module. But it doesn't extract themerge
object from thedefault
property of the imported ES module.Thus, calling
merge.all
will raise the error, instead it should be called asmerge.default.all
, but of cause it cannot be an acceptable solution.The text was updated successfully, but these errors were encountered: