Skip to content

Search page project does not build after upgrading v2 Atomic/Headless dependencies #1491

Description

@lbergeron

Describe the bug

I created an Atomic code search page project using the CLI. The project was generated with @coveo/atomic@2.56.0 and @coveo/headless@2.48.0.

After updating the package.json file to use @coveo/atomic@2.79.1 and @coveo/headless@2.80.6 the project wouldn't build anymore raising many errors similar to this one:

[ ERROR ]  TypeScript: ./node_modules/@coveo/headless/dist/definitions/features/commerce/context/cart/cart-selector.d.ts:39:44
           Namespace
           '"MY_SEARCH_PAGE_PROJECT/node_modules/reselect/es/index"'
           has no exported member 'weakMapMemoize'.

     L38:  } & {
     L39:      argsMemoize: typeof import("reselect").weakMapMemoize;
     L40:      memoize: typeof import("reselect").weakMapMemoize;

To Reproduce

Steps to reproduce the behavior:

  1. Run coveo ui:create:atomic
  2. Update the package.json and set the latest versions of @coveo/atomic and @coveo/headless
  3. Update the coveo.deploy.json file accordingly.
  4. Run npm install
  5. Run npm run build
  6. See the errors in the command line console

Expected behavior

A clear and concise description of what you expected to happen.

Once package.json and coveo.deploy.json are updated and npm install is done, npm run build should build correctly.

Screenshots

n/a

Desktop (please complete the following information):

  • OS: Linux
    • OS version: Ubuntu 20.04
  • Browser n/a
    • Browser version: n/a
  • Version of the CLI 3.2.7
  • Local Node version: 20.18.1
  • Local NPM/Yarn version: 10.9.1

Additional context

I was able to fix the issue by applying the following changes to the generated project.

  1. In package.json, set:
    1. @coveo/atomic to 2.79.1
    2. @coveo/headless to 2.80.6
    3. @stencil/core to 4.20.0
  2. In stencil.config.ts, replace
{
  type: "dist-custom-elements-bundle",
  minify: false,
  includeGlobalScripts: true,
  externalRuntime: false,
  inlineDynamicImports: false,
  dir: "dist/components",
},

by

{
  type: "dist-custom-elements",
  customElementsExportBehavior: "bundle",
  minify: false,
  includeGlobalScripts: true,
  generateTypeDeclarations: false,
  externalRuntime: false,
},
  1. In tsconfig.json add "skipLibCheck": true to compilerOptions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions