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

Scripts using pulse crash without installed tslib package #60

Open
mrtusc opened this issue Nov 13, 2024 · 3 comments
Open

Scripts using pulse crash without installed tslib package #60

mrtusc opened this issue Nov 13, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@mrtusc
Copy link

mrtusc commented Nov 13, 2024

Description

Scripts using pulse do not start without installed tslib package. Instead they crash and show the error message "Error: Cannot find module 'tslib'".

To reproduce the error, just do the following in an empty folder:

npm init -y
npm install @pulsecron/pulse
echo "const p = require('@pulsecron/pulse')" > index.js
node index.js

With an additional npm install tslib the script runs without error.

Expected behavior

The script should run without error even without explicitely adding tslib as dependency.

Code example

No response

Additional context

Used versions:

@mrtusc mrtusc added the bug Something isn't working label Nov 13, 2024
@erwanriou
Copy link

I confirm the issue on docker node:20.9.0-alpine it require the tslib even if plain javascript code is used.

@peterdzl
Copy link

peterdzl commented Jan 7, 2025

I found that this is caused by using

npm ci --omit=dev

I get the above missing tslib error when I install omitting devDependencies, but it works fine if dev-deps are included - irrespective of the docker image (node:20-bookworm in my case)

@Nickk4
Copy link

Nickk4 commented Jan 10, 2025

I also believe tslib should be added to the dependencies. When I used npm I had no problems, but after switching to yarn:

Error: @pulsecron/pulse tried to access tslib, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: tslib
Required by: @pulsecron/pulse@npm:1.6.7 (via C:***\Yarn\Berry\[email protected]\node_modules@pulsecron\pulse\dist)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants