You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I temporarily reverted this in #166 to make the CI pass again.
To Reproduce
Steps to reproduce the behavior:
Upgrade @jellyfin/sdk to 0.8.1 or higher
Run yarn start
Expected behavior
The build and tests are passing.
Actual behaviour:
yarn run v1.22.19
$ nest start
E:\jellyfin-discord-music-bot\dist\clients\jellyfin\jellyfin.search.service.js:14
const models_1 = require("@jellyfin/sdk/lib/generated-client/models");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\jellyfin-discord-music-bot\node_modules\@jellyfin\sdk\lib\generated-client\models\index.js from E:\jellyfin-discord-music-bot\dist\clients\jellyfin\jellyfin.search.service.js not supported.
Instead change the require of index.js in E:\jellyfin-discord-music-bot\dist\clients\jellyfin\jellyfin.search.service.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (E:\jellyfin-discord-music-bot\dist\clients\jellyfin\jellyfin.search.service.js:14:18)
at Object.<anonymous> (E:\jellyfin-discord-music-bot\dist\clients\jellyfin\jellyfin.module.js:14:35)
at Object.<anonymous> (E:\jellyfin-discord-music-bot\dist\clients\discord\discord.module.js:14:27)
at Object.<anonymous> (E:\jellyfin-discord-music-bot\dist\app.module.js:19:26)
at Object.<anonymous> (E:\jellyfin-discord-music-bot\dist\main.js:4:22)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Additional context
It might be possible to work around this with dynamic modules (Stackoverflow issue for context).
The Jellyfin SDK could also be made for commonjs, but that might be a lot of additional work.
I think it's best to keep up with updates and use a workaround, until Nestjs implemented proper handling for ESM.
The ideal solution would be, to use ESM instead. However, the PR in Nestjs has been stale for over 2 years.
I doubt that there will be any progress on it anytime soon. If there should be support for this someday, the asynchronous imports should be reverted.
The text was updated successfully, but these errors were encountered:
Describe the bug
In the commit https://github.com/jellyfin/jellyfin-sdk-typescript/pull/341/files, the SDK was made to target ES6 properly.
During an automated pull request, that updated from the SDK 0.7.0 to 0.8.1 (#154), the project broke.
According to https://stackoverflow.com/questions/74830166/unable-to-import-esm-module-in-nestjs/75287028#75287028 and nestjs/nest#8736, Nestjs does not support ES modules.
This causes any following Github Actions to fail and not build the image.
I temporarily reverted this in #166 to make the CI pass again.
To Reproduce
Steps to reproduce the behavior:
@jellyfin/sdk
to0.8.1
or higheryarn start
Expected behavior
The build and tests are passing.
Actual behaviour:
Additional context
It might be possible to work around this with dynamic modules (Stackoverflow issue for context).
The Jellyfin SDK could also be made for commonjs, but that might be a lot of additional work.
I think it's best to keep up with updates and use a workaround, until Nestjs implemented proper handling for ESM.
The ideal solution would be, to use ESM instead. However, the PR in Nestjs has been stale for over 2 years.
I doubt that there will be any progress on it anytime soon. If there should be support for this someday, the asynchronous imports should be reverted.
The text was updated successfully, but these errors were encountered: