Skip to content

Couchbase Initialization Not Working #826

@joeyagreco

Description

@joeyagreco

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions