-
Notifications
You must be signed in to change notification settings - Fork 34
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
Module not found: Can't resolve 'tslib'
when importing transformImageUrl
#347
Comments
Hi @tommarshall, Thank you for the details and opening the issue here. As far as I understand the
|
Brief bug description
When importing
transformImageUrl
from@kentico/kontent-delivery
to build image transformation URLs, e.g. within a custom loader forNext/Image
.Repro steps
cms-kontent
example from the Next.js repo.yarn build
to build the project.Expected behaviour
The build should succeed.
Actual behaviour
The build fails with the following error:
Test environment
Additional context
Adding
tslib
as a dependency to the Next project (e.g.yarn add tslib
) fixes the error.tslib
is present in the@kentico/kontent-delivery
package-lock.json
, but it's listed as adev
dependency.Assuming
transformImageUrl
is part of the public API, which it appears to be as it's documented, then I thinktslib
needs to be moved from a dev dependency to a standard dependency.That's a straightforward fix that I can open a PR for, but given the error is occurring within a module of
kontent-core
, I'm not sure whether the right place to do that is in@kentico/kontent-delivery
or downstream in@kentico/kontent-core
. Guidance would be appreciated here...To date I think this has gone unnoticed as the majority of Kontent projects are likely importing other packages that depend on
tslib
, e.g. Kontent Starter Corporate - Next.js, which includestslib
as a dependency ofeslint-config-next
(via@typescript-eslint/parser
->@typescript-eslint/typescript-estree
->tsutils
->tslib
)The text was updated successfully, but these errors were encountered: