Skip to content

Can't resolve padandoc-node-client modules #28

@edem-ca

Description

@edem-ca

When attempting to install pandadoc-node-client, the dependencies do not seem to be compiling correctly. When I insert the following line into my preact application:

import * as pd_api from "pandadoc-node-client"

I get the following error in my terminal:

⚠ WARN ../node_modules/pandadoc-node-client/node_modules/node-fetch/lib/index.mjs
Module not found: Error: Can't resolve 'encoding' in './node_modules/pandadoc-node-client/node_modules/node-fetch/lib'
 @ ../node_modules/pandadoc-node-client/node_modules/node-fetch/lib/index.mjs
 @ ../node_modules/pandadoc-node-client/dist/http/isomorphic-fetch.js
 @ ../node_modules/pandadoc-node-client/dist/http/http.js
 @ ../node_modules/pandadoc-node-client/dist/index.js
 @ ../node_modules/babel-loader/lib??ref--4!./routes/hipaa/index.js
 @ ./routes/hipaa/index.js
 @ ./components/app.js
 @ ./index.js
 @ ../node_modules/preact-cli/lib/lib/entry.js

WARNING in ../node_modules/pandadoc-node-client/node_modules/node-fetch/lib/index.mjs 1215:10-13
"export 'default' (imported as 'Url') was not found in 'url'

And this console error in my browser when I attempt to load my preact page:

Screen Shot 2023-02-03 at 3 40 19 PM

Node Version: v18.14.0

Starter app was built using: npx preact-cli create default <project-name>
https://github.com/preactjs/preact-cli/blob/master/README.md

When I remove the import statement the page renders normally, so I know it has to be something to do with pandadoc-node-client itself, or how my version(s) of node/preact interact with it. Any help would be much appreciated 👌🏾

Metadata

Metadata

Assignees

No one assigned

    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