question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make `cardinal` an optional dependency

See original GitHub issue

I am currently trying to reduce to package footprint of some of my projects:

cardinal is only used in 2 places to highlight code, which in turns requires redeyed which in turn requires esprima.

I suggest either removing it from dependencies or making it an optional dependency since it is only required in debug mode, you might print a message install cardinal for pretty debug formatting or something.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
catamphetaminecommented, Jan 14, 2021

@sidorares

in the latest versions require(‘cardinal’) is wrapped in try/catch block and should not produce an error

No, still the same error with the latest 2.2.5 version.

c:/dev/JITU/node_modules/mysql2/lib/helpers.js
Module not found: Error: Can't resolve 'cardinal' in 'c:\dev\JITU\node_modules\mysql2\lib'
resolve 'cardinal' in 'c:\dev\JITU\node_modules\mysql2\lib'
cat c:\dev\JITU\node_modules\mysql2\package.json
{
  "name": "mysql2",
  "version": "2.2.5",
3reactions
sidorarescommented, Jan 11, 2021

@ashokkumarg in the latest versions require('cardinal') is wrapped in try/catch block and should not produce an error - https://github.com/sidorares/node-mysql2/blob/a640d471f043eb078c09ab0d6016030c315bd879/lib/helpers.js#L28

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I make a pattern rule dependency optional in a ...
I would like make to reference the timestamp of a dependency if and only if the file already exists. I have a pattern...
Read more >
Maven – Optional Dependencies and Dependency Exclusions
If a user wants to use functionality related to an optional dependency, they have to redeclare that optional dependency in their own project....
Read more >
V 2.2.4 : Cardinal Mobile SDK Android Documentation Overview
This is a simple 6-Step process to get your application up and running 3DS 2.0 transactions, with the option to customize challenge screens ......
Read more >
cardinal · PyPI
cardinal is a Python package to perform and monitor Active Learning experiments ... Optional dependencies are also handled by pip in the following...
Read more >
Cardinal 22.05 has been released | KXStudio News
A new Audio to CV Pitch module also makes a debut, ... For packagers: fftw3f is now an optional dependency, required for "Audio...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found