question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API(8.1.1-canary.28): error logged when importing child_process

See original GitHub issue

Bug report

Describe the bug

Errors are shown in the logs when trying to import child_process in an api function.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create an api function
// /pages/api/hello.js
import 'child_process';
export default (req, res) => {
  res.end('hello');
};
  1. start next dev server
  2. visit http://localhost:3000/api/hello in the browser
  3. See error
[ error ] ./pages/api/hello.js
Module not found: Can't resolve 'child_process' in '<project-root>/pages/api'

Expected behavior

No error

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of Next.js: 8.1.1-canary.28

Additional context

Functionally there doesn’t seem to be any problem, looks like it’s just a logging problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Janpotcommented, May 16, 2019

I’m aware, just test driving new features. I can hold off on opening a ticket like this if you think it’s too early, or report somewhere else.

0reactions
balazsorban44commented, Jan 31, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next.js API routes (and pages) should support reading files
It's currently not possible to read files from API routes or pages ... API(8.1.1-canary.28): error logged when importing child_process #7334.
Read more >
Understanding Errors and Rejected Lines When Importing ...
We are reproducing the same steps as above through API calls; Let's import data in a module with the incorrect mapping (spelling error...
Read more >
An error appears when importing data from Google Drive in ...
Solution. Follow the "message" entry in the DSS error log to go to the Google Developer console and enable the Google Drive API....
Read more >
Resolve import errors API | Kibana Guide [8.5] - Elastic
Resolve errors from the Import objects API. To resolve errors, you can: Retry certain saved objects; Overwrite specific saved objects; Change references to ......
Read more >
500 - Unexpected error while importing wsdl
While loading a particular wsdl, it loads successfully in the browser. But when i try to import the same via API manager, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found