How to use node-libcurl with NextJS using native-ext-loader?
See original GitHub issueI need Help please!
I am getting the following error when running my code on the browser:
I am using NextJS on a Netlify build image that uses Ubuntu version 16.04 (aka Xenial) as the base.
my next.config.js is set as follows:
As you can see I’m using native-ext-loader as a way to load your npm package into my build.
I’m assuming the error is basically saying it can not find the binary files that I am trying to include in the config above.
Please let me know if you need anything else in helping resolve this issue.
Thanks in advance, Antonio.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Repercussions of node-pre-gyp's find method · Issue #204 · JCMais ...
The usage of a dynamic require(..) call for locating the binding. This require statement to load the native binding: node-libcurl/lib/ ...
Read more >Upgrade Guide - Next.js
To update to Next.js version 13, run the following command using your preferred ... and style images, better accessibility, and native browser lazy...
Read more >Making cURL Requests in Node.js - Section.io
cURL (client URL) is a free tool used to make network requests from the terminal using various protocols available.
Read more >curl.js AMD Loader - David Walsh Blog
This configuration allows you to provide plugin paths, modules paths, and more. Basic define and require with curl.js. Basic usage of curl.js is ......
Read more >node-libcurl installation fails on MacOS Catalina: clang: error
The problem comes from newer versions of Xcode command line tools on recent MacOS versions. The crucial part in the log is:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@JCMais I can confirm that your suggestion to use
getServerSidePropsaddressed my issue. I had to use it as an async function per the following code. Please note I am usingNextJS v10.0.6.For anyone trying this as a fix, please note to use the following structure of your returned data where
datais whatever object you wish to return:return { props: {data} }If you do not use this structure you will get an error.
Thank you for your help, and I hope this helps anyone who has the same issue I did.
Glad you got it working @9ntonio, and thanks for posting the full solution.