Pnpjs: Can not resolve NodeFetchClient

Created on 3 Jun 2019  路  4Comments  路  Source: pnp/pnpjs

Category

  • [ ] Enhancement
  • [x] Bug
  • [ ] Question
  • [ ] Documentation gap/issue

Version

Please specify what version of the library you are using: [ 1.3.3 ]

Please specify what version(s) of SharePoint you are targeting: [ SPO ]

Observed Behavior

pnpjs/packages/nodejs/src/net/adalcertificatefetchclient.ts
Can not resolve NodeFetchClient

App threw an error during load
Error: Cannot find module '.'
Require stack:
- C:\***\node_modules\@pnp\nodejs\dist\nodejs.es5.umd.js
- C:\***\node_modules\electron\dist\resources\default_app.asar\main.js
-
    at Module._resolveFilename (internal/modules/cjs/loader.js:659:15)
    at Function.Module._resolveFilename (C:\***\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:43:12)
    at Function.Module._load (internal/modules/cjs/loader.js:577:27)
    at Module.require (internal/modules/cjs/loader.js:715:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at C:\***\node_modules\@pnp\nodejs\dist\nodejs.es5.umd.js:11:217
    at Object.<anonymous> (C:\***\node_modules\@pnp\nodejs\dist\nodejs.es5.umd.js:14:2)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
    at Module.load (internal/modules/cjs/loader.js:677:32)

https://github.com/pnp/pnpjs/blob/e73472240b8c8fbec0c12ccc121884056935b866/packages/nodejs/src/net/adalcertificatefetchclient.ts#L9

Expected / Desired Behavior

import { NodeFetchClient } from "./nodefetchclient";

Steps to Reproduce

Follow Getting Started: Nodejs with latest version

code fixed bug

Most helpful comment

Any chance of actually _releasing_ this bug fix?

All 4 comments

I can confirm that this is problem as I have just encountered it and I tracked it down to the very same line: import { NodeFetchClient } form ".";

Faced this issue just now trying to require the SPFetchClient in Nodejs azure func.
const SPFetchClient = require("@pnp/nodejs").SPFetchClient;

Closing this as it is fixed in the merged PR #729. Will be included in 1.3.4 release.

Any chance of actually _releasing_ this bug fix?

Was this page helpful?
0 / 5 - 0 ratings