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

The inferred type of 'storyblokApi' cannot be named without a reference to '@storyblok/js/node_modules/storyblok-js-client'. #390

Open
1 task done
Theofilos-Chamalis opened this issue Oct 24, 2023 · 0 comments
Labels
pending-author [Issue] Add Storyblok employee pending-triage [Issue] Add labels to describe it or prioritise it

Comments

@Theofilos-Chamalis
Copy link

Describe the issue you're facing

We are using the @storyblok/js library in our NX monorepo and upgrading to the latest NX version v17.0.1 from v15.8.7 has resulted in the following error when trying to build the project:

✖  nx run storyblok:build
     Bundling storyblok...
     Error during bundle: Error: libs/storyblok/src/lib/storyblok.ts:3:16 - error TS2742: The inferred type of 'storyblokApi' cannot be named without a reference to '@storyblok/js/node_modules/storyblok-js-client'. This is likely not portable. A type annotation is necessary.
       
       export const { storyblokApi } = storyblokInit({
                        ~~~~~~~~~~~~
       
       Bundle failed: storyblok

We are currently using storyblok/js v1.8.5 and storyblok-js-client v3.3.1, however we have also tried using the latest storyblok/js version v2.3.0

Reproduction

n/a

Steps to reproduce

No response

System Info

System:
    OS: Linux 6.5 Manjaro Linux
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
    Memory: 9.27 GB / 15.29 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 18.18.0 - ~/.volta/tools/image/node/18.18.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 7.24.2 - ~/Projects/EF/martech-toolkit/node_modules/.bin/npm
    Watchman: 20231013.222836.0 - /usr/bin/watchman
  Browsers:
    Brave Browser: 118.1.59.120

Used Package Manager

npm

Error logs (Optional)

✖  nx run storyblok:build
     Bundling storyblok...
     Error during bundle: Error: libs/storyblok/src/lib/storyblok.ts:3:16 - error TS2742: The inferred type of 'storyblokApi' cannot be named without a reference to '@storyblok/js/node_modules/storyblok-js-client'. This is likely not portable. A type annotation is necessary.
       
       export const { storyblokApi } = storyblokInit({
                        ~~~~~~~~~~~~
       
       Bundle failed: storyblok

Validations

@Theofilos-Chamalis Theofilos-Chamalis added pending-author [Issue] Add Storyblok employee pending-triage [Issue] Add labels to describe it or prioritise it labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Add Storyblok employee pending-triage [Issue] Add labels to describe it or prioritise it
Projects
None yet
Development

No branches or pull requests

1 participant