Search page project does not build after upgrading v2 Atomic/Headless dependencies
- Dominant language
- TypeScript
- Stars
- 25
- Forks
- 7
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 1
Description
## 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
```javascript
{
type: "dist-custom-elements-bundle",
minify: false,
includeGlobalScripts: true,
externalRuntime: false,
inlineDynamicImports: false,
dir: "dist/components",
},
```
by
```javascript
{
type: "dist-custom-elements",
customElementsExportBehavior: "bundle",
minify: false,
includeGlobalScripts: true,
generateTypeDeclarations: false,
externalRuntime: false,
},
```
3. In `tsconfig.json` add `"skipLibCheck": true` to `compilerOptions`
Contributor guide
Research direction
Inspect the generated Atomic project files package.json, stencil.config.ts, and tsconfig.json, comparing the dependency versions and configuration shown in the report. Reproduce the upgrade with coveo ui:create:atomic, npm install, and npm run build; done means the generated project builds successfully with the updated Atomic and Headless dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100