Skip to content

Conversation

@phdargen
Copy link
Contributor

@phdargen phdargen commented Dec 12, 2025

Description

Fixes a build issue for next projects using the Bazaar discovery extensions:

@x402/next-example:build: Failed to load bazaar extension: Error: Cannot find module 'x402/typescript/packages/extensions/node_modules/ajv/dist/2020' imported from 402/typescript/packages/extensions/dist/esm/chunk-STXY3Q5R.mjs
@x402/next-example:build: Did you mean to import "ajv/dist/2020.js"?
@x402/next-example:build:     at ignore-listed frames {
@x402/next-example:build:   code: 'ERR_MODULE_NOT_FOUND',
@x402/next-example:build:   url: 'file:///x402/typescript/packages/extensions/node_modules/ajv/dist/2020'

Closes #876

Tests

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits

@cb-heimdall
Copy link

cb-heimdall commented Dec 12, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link

vercel bot commented Dec 12, 2025

@phdargen is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

*/

import Ajv from "ajv/dist/2020";
import Ajv from "ajv/dist/2020.js";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, /dist should not be read from.

Can you investigate if this can be done without reading from /dist? @phdargen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the only way to import JSON Schema draft-2020-12, see https://ajv.js.org/json-schema.html#draft-2020-12

As an alternative we could switch to draft-07 with this import import Ajv from "ajv";
This would require changing: "$schema": "https://json-schema.org/draft/2020-12/schema" -> $schema: "http://json-schema.org/draft-07/schema#" in:

  • typescript/packages/extensions/src/bazaar/resourceService.ts
  • typescript/packages/extensions/src/bazaar/types.ts
  • go/extensions/bazaar/resource_service.go

Let me know what you prefer @CarsonRoscoe

@CarsonRoscoe CarsonRoscoe merged commit f7daf43 into coinbase:main Jan 5, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Ajv import in TypeScript extension bazaar facilitator is missing file extension

3 participants