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

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

Open
lbergeron opened this issue Jan 9, 2025 · 0 comments

Comments

@lbergeron
Copy link

Describe the bug

I created an Atomic code search page project using the CLI. The project was generated with @coveo/[email protected] and @coveo/[email protected].

After updating the package.json file to use @coveo/[email protected] and @coveo/[email protected] 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
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