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

Module '"@scaleway/sdk"' has no exported member 'Registry' #1474

Open
empz opened this issue Oct 8, 2024 · 6 comments · Fixed by #1667
Open

Module '"@scaleway/sdk"' has no exported member 'Registry' #1474

empz opened this issue Oct 8, 2024 · 6 comments · Fixed by #1667
Assignees
Labels
bug Something isn't working priority:highest Bugs filled by customers, security issues

Comments

@empz
Copy link

empz commented Oct 8, 2024

"version": "2.49.1"

@empz
Copy link
Author

empz commented Oct 8, 2024

This hasn't been working for the past 7 months. Latest version that exports Registry is 2.21.1.

How did nobody noticed this in 7 months....???

@Codelax
Copy link
Member

Codelax commented Oct 17, 2024

Hi, I tried the simple example found in the README that imports Registry.
I don't have any issue with 2.49.1 or latest version.

@Codelax
Copy link
Member

Codelax commented Oct 29, 2024

This issue happens when using "moduleResolution": "nodenext.
This can be reproduced in examples/nodejs-minimal using this patch:

diff --git a/examples/nodejs-minimal/tsconfig.json b/examples/nodejs-minimal/tsconfig.json
index 0b8c63e..6a9e595 100644
--- a/examples/nodejs-minimal/tsconfig.json
+++ b/examples/nodejs-minimal/tsconfig.json
@@ -1,7 +1,7 @@
 {
   "compilerOptions": {
-    "module": "ESNext",
-    "moduleResolution": "Bundler",
+    "module": "nodenext",
+    "moduleResolution": "nodenext",
     "target": "ES2022",
     "outDir": "./dist",
     "strict": true,

This generate errors for multiple d.ts files:

node_modules/@scaleway/sdk/dist/index.d.ts:16:15 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

16 export * from './api';
                 ~~~~~~~

Generated *.d.ts files miss files extensions when importing.

@Codelax Codelax added bug Something isn't working priority:highest Bugs filled by customers, security issues labels Oct 29, 2024
@mjeanroy
Copy link

mjeanroy commented Feb 7, 2025

Hi 👋
I have still the problem with the latest version (2.64.0).
This issue should be re-opened as this PR does not seem to fix the problem (or it partially fixed the problem).

@jremy42
Copy link
Contributor

jremy42 commented Feb 13, 2025

Hi 👋

Thanks for your feedback. Could you confirm if the issue you’re facing is exactly the same as before, or if there are new symptoms? If there’s anything different, could you provide more details? That would help us investigate further. 🚀

@mjeanroy
Copy link

mjeanroy commented Feb 13, 2025

Thanks for your answer 👋

Yes, this is the same as before.
You can reproduce using @Codelax description, or check this commit I just pushed to reproduce the problem on a fork: mjeanroy@007b26a

  • In examples/nodejs-minimal, update @scaleway/sdk to the latest version.
  • Change module and moduleResolution in the examples/nodejs-minimal/tsconfig.json
  • It should not compile

Or checkout my fork, then:

  • cd examples/nodejs-minimal
  • pnpm install
  • pnpm run build

It should output:

node_modules/.pnpm/@scaleway+configuration-loader@1.0.5/node_modules/@scaleway/configuration-loader/dist/index.d.ts:1:123 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './config-loader.js'?

1 export { loadAllProfilesFromConfigurationFile, loadProfileFromConfigurationFile, loadProfileFromEnvironmentValues, } from './config-loader';
                                                                                                                            ~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+configuration-loader@1.0.5/node_modules/@scaleway/configuration-loader/dist/index.d.ts:2:81 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

2 export type { AllProfilesFromFileParams, Profile, ProfileFromFileParams, } from './types';
                                                                                  ~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/index.d.ts:2:110 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

2 export type { NetworkInterceptors, RequestInterceptor, ResponseInterceptor, ResponseErrorInterceptor, } from './internal/interceptors/types';
                                                                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/index.d.ts:4:29 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

4 export type { Logger } from './internal/logger/logger';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/index.d.ts:14:35 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

14 export type { Region, Zone } from './scw/locality';
                                     ~~~~~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/index.d.ts:15:15 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

15 export * from './internals';
                 ~~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/index.d.ts:16:15 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

16 export * from './api';
                 ~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/internal/logger/index.d.ts:2:29 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

2 import type { Logger } from './logger';
                              ~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/scw/client-ini-profile.d.ts:1:35 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

1 import type { Region, Zone } from './locality';
                                    ~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/scw/client-settings.d.ts:1:83 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

1 import type { NetworkInterceptors, RequestInterceptor, ResponseInterceptor } from '../internal/interceptors/types';
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/scw/fetch/build-fetcher.d.ts:2:55 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

2 import type { ResponseUnmarshaller, ScwRequest } from './types';
                                                        ~~~~~~~~~

src/index.ts:2:10 - error TS2305: Module '"@scaleway/sdk"' has no exported member 'Registry'.

2 import { Registry, createClient } from '@scaleway/sdk'
           ~~~~~~~~


Found 12 errors in 7 files.

Errors  Files
     2  node_modules/.pnpm/@scaleway+configuration-loader@1.0.5/node_modules/@scaleway/configuration-loader/dist/index.d.ts:1
     5  node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/index.d.ts:2
     1  node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/internal/logger/index.d.ts:2
     1  node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/scw/client-ini-profile.d.ts:1
     1  node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/scw/client-settings.d.ts:1
     1  node_modules/.pnpm/@scaleway+sdk@2.65.0/node_modules/@scaleway/sdk/dist/scw/fetch/build-fetcher.d.ts:2
     1  src/index.ts:2
 ELIFECYCLE  Command failed with exit code 2.

@Codelax Codelax reopened this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:highest Bugs filled by customers, security issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants