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

Missing "./lib/styles/styles.css" specifier in "@elastic/react-search-ui-views" package #1048

Open
h0444xk8 opened this issue May 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@h0444xk8
Copy link

h0444xk8 commented May 24, 2024

Hi all,

maybe a bug?

Bug description
Since version 1.21.3 we get the following error message while yarn build. The version 1.21.2 is working fine.

Error message

Error message on local developer machine with Node 20

X [ERROR] Missing "./lib/esm/view-helpers" specifier in "@elastic/react-search-ui-views" package [plugin vite:dep-scan] src/components/search/pagingView/PagingView.tsx:4:32: 4 ¦ ...sName } from '@elastic/react-search-ui-views/lib/esm/view-helpers';

Error message on GitLab Ci pipeline with Node 18.19 and 22.2

Error: [commonjs--resolver] Missing "./lib/esm/view-helpers" specifier in "@elastic/react-search-ui-views" package at e (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:47597:25) at n (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:47597:627) at o (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:47597:1297) at resolveExportsOrImports (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:48287:20) at resolveDeepImport (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:48306:31) at tryNodeResolve (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:48031:20) at Object.resolveId (file:///builds/<secretpath>/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:47781:28) at file:///builds/<secretpath>/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19774:40 at async PluginDriver.hookFirstAndGetPlugin (file:///builds/<secretpath>/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19674:28) at async resolveId (file:///builds/<secretpath>/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:18355:26) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Cleaning up project directory and file based variables 00:00 ERROR: Job failed: exit code 1

To Reproduce
Steps to reproduce the behavior:

  1. use package.json with following dependencies
    "dependencies": { "@elastic/react-search-ui": "1.21.3", "@elastic/react-search-ui-views": "1.21.3", "@elastic/search-ui-app-search-connector": "1.21.3", "@elastic/search-ui-engines-connector": "1.21.3",
  2. yarn install
  3. yarn build

Expected behavior
No build error as for 1.21.2

Which backends and packages are you using:
Backend: App Search, Elasticsearch, Node, NGINX

Packages:

It doesnt work for 1.21.3 and 1.21.4

"dependencies": { "@elastic/react-search-ui": "1.21.3", "@elastic/react-search-ui-views": "1.21.3", "@elastic/search-ui-app-search-connector": "1.21.3", "@elastic/search-ui-engines-connector": "1.21.3", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@fontsource/bebas-neue": "^5.0.20", "@fontsource/pt-sans": "^5.0.13", "@mui/icons-material": "^5.15.16", "@mui/material": "^5.15.16", "@mui/styled-engine-sc": "^5.14.12", "@mui/styles": "^5.15.16", "@reduxjs/toolkit": "^2.2.3", "i18next": "^23.11.3", "jwt-decode": "^4.0.0", "oidc-client-ts": "^3.0.1", "rc-pagination": "^4.0.4", "react": "^18.3.1", "react-dom": "^18.3.1", "react-i18next": "^14.1.1", "react-markdown": "^9.0.1", "react-oidc-context": "^3.1.0", "react-redux": "^9.1.2", "react-router-dom": "^6.23.0", "react-scripts": "^5.0.1", "rehype-raw": "^7.0.0", "styled-components": "^6.1.9", "vite-plugin-svgr": "^4.2.0"

@h0444xk8 h0444xk8 added the bug Something isn't working label May 24, 2024
@joemcelroy
Copy link
Member

hmm we should of addressed this in 1.21.4 with this change https://github.com/elastic/search-ui/pull/1045/files.

Looking at the error, its complaining about ./lib/esm/view-helpers. Are you directly importing any functions from the library?

@h0444xk8
Copy link
Author

Yes we are using

import { appendClassName } from '@elastic/react-search-ui-views/lib/esm/view-helpers';

om one our tsx pages

@joemcelroy
Copy link
Member

try removing that (copy the fn) and see if it works. We will need to create a export path for these view helpers long term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants