Skip to content

require('koa-body/unparsed.js') throws MODULE_NOT_FOUND error #222

@tafel

Description

@tafel

Describe the bug

Node.js version: 18.12.0

OS version: docker node:18.12.0-bullseye

Description:

Documentation says that unparsed body can be accessed with const unparsed = require('koa-body/unparsed.js');. But it throws an error instead.

Actual behavior

MODULE_NOT_FOUND : Cannot find module 'koa-body/unparsed.js'

Expected behavior

It should require the unparsed script

Code to reproduce

const unparsed = require('koa-body/unparsed.js');

Fix suggestion

Maybe it is not the best fix, but it is possible to require the file by changing the path:

const unparsed = require('koa-body/lib/unparsed.js').default;

If it is a viable solution, README.md should be updated to reflect this.

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions