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 requested module 'bitbucket' does not provide an export named 'Bitbucket' & A top-level 'export' modifier cannot be used on value declarations #139

Open
NatoBoram opened this issue Sep 17, 2024 · 0 comments

Comments

@NatoBoram
Copy link

I'm trying to use this package in a modern TypeScript setup and it's failing both during build time and when running in dev mode with tsx.

The minimal reproduction steps are at https://github.com/NatoBoram/node-bitbucket-bug-report.

import type { APIClient } from "bitbucket"
import { Bitbucket } from "bitbucket"
import { BITBUCKET_BASE_URL, BITBUCKET_TOKEN } from "./node/env.js"

export const bitbucket: APIClient = new Bitbucket({
	auth: { token: BITBUCKET_TOKEN },
	baseUrl: BITBUCKET_BASE_URL.toString(),
	request: { agent: "@natoboram/node-bitbucket-bug-report", fetch: fetch },
})

I captured the failures in a GitHub Workflow: https://github.com/NatoBoram/node-bitbucket-bug-report/actions/runs/10907449165

SyntaxError: The requested module 'bitbucket' does not provide an export named 'Bitbucket'

/home/nato/Code/github.com/NatoBoram/node-bitbucket-bug-report/src/client.ts:2
import { Bitbucket } from "bitbucket"
         ^

SyntaxError: The requested module 'bitbucket' does not provide an export named 'Bitbucket'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:171:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:254:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled

node_modules/.pnpm/[email protected]/node_modules/bitbucket/src/error/types.ts:4:1 - error TS1287: A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled.

4 export abstract class HTTPError extends Error {
  ~~~~~~


Found 1 error in node_modules/.pnpm/[email protected]/node_modules/bitbucket/src/error/types.ts:4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant