octet-stream / form-data

Spec-compliant FormData implementation for Node.js
https://www.npmjs.com/package/formdata-node
MIT License
142 stars 17 forks source link

ERR_PACKAGE_PATH_NOT_EXPORTED in version 5.0.1 #64

Closed Joshua-alt closed 1 year ago

Joshua-alt commented 1 year ago

No "exports" main defined in /home/joshua/Documents/softProjet/authapigun-master/node_modules/formdata-node/package.json

the version 4.4.1 work fine and don't have this error. I use nodejs18

octet-stream commented 1 year ago

Hi. Thanks for the feedback. How can I reproduce it? I have created a minimal project with formdata-node@5.0.1 (installed via pnpm), and I don't see the problem.

Joshua-alt commented 1 year ago

don’t module try to import as const {File}=require(“FormData-mode”) Le ven. 7 juil. 2023 à 13:22, Nick K. @.***> a écrit :

Hi. Thanks for the feedback. How can I reproduce it? I have created a minimal project with @.*** (installed via pnpm), and I don't see the problem.

— Reply to this email directly, view it on GitHub https://github.com/octet-stream/form-data/issues/64#issuecomment-1625266094, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQD4P5SF6EPQZXYPNMNOQ3XO7WRBANCNFSM6AAAAAA2BVH6CY . You are receiving this because you authored the thread.Message ID: @.***>

octet-stream commented 1 year ago

This shouldn't work, because formdata-node does not support CJS starting from 5.x If you need CJS, then either stay on 4.x version or import the package using dynamic import() syntax.

octet-stream commented 1 year ago

v6 brings back CJS support and it's available now, check out release notes for more information: https://github.com/octet-stream/form-data/releases/tag/v6.0.0