8000 API(8.1.1-canary.28): error logged when importing child_process · Issue #7334 · vercel/next.js · GitHub
[go: up one dir, main page]

Skip to content
API(8.1.1-canary.28): error logged when importing child_process #7334
@Janpot

Description

@Janpot

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0