Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF generation script crashes as soon as we import the pdfkit module. #1462

Open
RiadHossain43 opened this issue Sep 13, 2023 · 0 comments
Open

Comments

@RiadHossain43
Copy link

RiadHossain43 commented Sep 13, 2023

Bug Report

Script crashes as soon as we import the pdfkit module. This has been introduced few hours ago

Description of the problem

Following error is found in console which clearly states that 'functions-have-names' is not found.

Error: Cannot find module 'functions-have-names'
Require stack:

  • F:\ims_systems\ims_core_libs\node_modules\set-function-name\index.js
  • F:\ims_systems\ims_core_libs\node_modules\regexp.prototype.flags\implementation.js
  • F:\ims_systems\ims_core_libs\node_modules\regexp.prototype.flags\index.js
  • F:\ims_systems\ims_core_libs\node_modules\deep-equal\index.js
  • F:\ims_systems\ims_core_libs\node_modules\fontkit\dist\main.cjs
  • F:\ims_systems\ims_core_libs\node_modules\pdfkit\js\pdfkit.js
  • F:\ims_systems\ims_core_libs\lib\pdf\index.js
  • F:\ims_systems\ims_core_libs\lib\pdf\testOutput.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object. (F:\ims_systems\ims_core_libs\node_modules\set-function-name\index.js:5:38)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'F:\ims_systems\ims_core_libs\node_modules\set-function-name\index.js',
    'F:\ims_systems\ims_core_libs\node_modules\regexp.prototype.flags\implementation.js',
    'F:\ims_systems\ims_core_libs\node_modules\regexp.prototype.flags\index.js',
    'F:\ims_systems\ims_core_libs\node_modules\deep-equal\index.js',
    'F:\ims_systems\ims_core_libs\node_modules\fontkit\dist\main.cjs',
    'F:\ims_systems\ims_core_libs\node_modules\pdfkit\js\pdfkit.js',
    'F:\ims_systems\ims_core_libs\lib\pdf\index.js',
    'F:\ims_systems\ims_core_libs\lib\pdf\testOutput.js'
    ]
    }

Code sample

The errors occur as soon as the module is imported as following

const PDFDocument = require("pdfkit");

One thing I noticed is that the package regexp.prototype.flags was updated 8 hours ago in the npm, don't know if the bug has occurred from any version related issue internally. Please this is impacting my production application.

Your environment

  • pdfkit version: ^0.13.0
  • Node version: 16.20.1
  • Browser version (if applicable):
  • Operating System: Windows 11
@RiadHossain43 RiadHossain43 changed the title PDF generation script crashes as soon as we import the pdfkit module. This has been introduced few hours ago PDF generation script crashes as soon as we import the pdfkit module. Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant