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

Couchbase Initialization Not Working #826

Open
joeyagreco opened this issue Aug 28, 2024 · 1 comment
Open

Couchbase Initialization Not Working #826

joeyagreco opened this issue Aug 28, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@joeyagreco
Copy link

joeyagreco commented Aug 28, 2024

Expected Behaviour
Able to initialize Couchbase as shown in examples


Actual Behaviour

  1. Imports needed are not available. These are the only available imports, which makes the examples and tests shown here and here not accessable for users.
  2. Get strange error when trying to initialize a test container: Cannot find module 'testcontainers/src/utils/bound-ports

Testcontainer Logs

> npx jest issue.test.ts
 FAIL  src/issue.test.ts
  ● Test suite failed to run

    Cannot find module 'testcontainers/src/utils/bound-ports' from '../../../node_modules/.pnpm/@[email protected]/node_modules/@testcontainers/couchbase/build/couchbase-container.js'

    Require stack:
      /Users/joeygreco/my_repo/node_modules/.pnpm/@[email protected]/node_modules/@testcontainers/couchbase/build/couchbase-container.js
      /Users/joeygreco/my_repo/node_modules/.pnpm/@[email protected]/node_modules/@testcontainers/couchbase/build/index.js
      src/issue.test.ts

    > 1 | import { CouchbaseContainer, StartedCouchbaseContainer } from '@testcontainers/couchbase';
        | ^
      2 |
      3 | let startedTestContainer;
      4 |

      at Resolver._throwModNotFoundError (../../../node_modules/.pnpm/[email protected]/node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.<anonymous> (../../../node_modules/.pnpm/@[email protected]/node_modules/@testcontainers/couchbase/src/couchbase-container.ts:10:1)
      at Object.<anonymous> (../../../node_modules/.pnpm/@[email protected]/node_modules/@testcontainers/couchbase/src/index.ts:1:1)
      at Object.<anonymous> (src/issue.test.ts:1:1)

Steps to Reproduce
Here's a basic Jest test that will fail with the above error:

import { CouchbaseContainer } from '@testcontainers/couchbase';

describe('test connection', () => {
  test('success', async () => {
    // usage shown in example here: https://testcontainers.com/modules/couchbase/
    const container1 = await new CouchbaseContainer().start();
  });
});

Additionally, these imports are not exported in the @testcontainers/couchbase npm package:

import { BucketDefinition } from "./bucket-definition";
import { CouchbaseService } from "./couchbase-service";

Environment Information

  • Operating System: MacOS
  • Docker Version: Docker version 27.1.1, build 6312585
  • Node version: v20.16.0
  • Testcontainers version: @testcontainers/[email protected]

Thanks!

@cristianrgreco cristianrgreco added the bug Something isn't working label Nov 15, 2024
@cristianrgreco
Copy link
Collaborator

Good point. Looks like the Couchbase module isn't setup correctly. PR welcome

@cristianrgreco cristianrgreco added the good first issue Good for newcomers label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants