Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Build failure: The required namespace "eui.provider" is not available #38

Closed
luminecs opened this issue Nov 14, 2022 · 3 comments · Fixed by #39
Closed

Build failure: The required namespace "eui.provider" is not available #38

luminecs opened this issue Nov 14, 2022 · 3 comments · Fixed by #39
Assignees
Labels
bug Something isn't working

Comments

@luminecs
Copy link

luminecs commented Nov 14, 2022

Hello, I encountered such a problem when starting eui-cljs/examples/sample-app, and Opening the http://localhost:3333/ doesn't show anything(GET http://localhost:3333/js/main.js net::ERR_ABORTED 404 (Not Found)), can you help me? I am new to clojure. thanks

deps  co.elastic/eui-cljs {:mvn/version "41.2.0"}

$ yarn start
yarn run v1.22.19
$ shadow-cljs watch app
shadow-cljs - config: /my-path/eui-cljs/examples/sample-app/shadow-cljs.edn
shadow-cljs - starting via "clojure"
shadow-cljs - HTTP server available at http://localhost:3333
shadow-cljs - server version: 2.15.6 running at http://localhost:9630
shadow-cljs - nREPL server started on port 43659
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[2022-11-14 21:46:39.092 - INFO] :shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/@elastic/eui/lib/components/icon/icon.js", :requires [{:line 599, :column 39}]}
[:app] Build failure:
The required namespace "eui.provider" is not available, it was required by "sample_app/core.cljs".
deps  co.elastic/eui-cljs {:mvn/version "64.0.0"}

$ yarn start
yarn run v1.22.19
$ shadow-cljs watch app
shadow-cljs - config: /my-path/eui-cljs/examples/sample-app/shadow-cljs.edn
shadow-cljs - starting via "clojure"
NPM dependency "@elastic/eui" has installed version "41.2.0"
"64.0.0" was required by jar:file:/my-path/.m2/repository/co/elastic/eui-cljs/64.0.0/eui-cljs-64.0.0.jar!/deps.cljs
shadow-cljs - HTTP server available at http://localhost:3333
shadow-cljs - server version: 2.15.6 running at http://localhost:9630
shadow-cljs - nREPL server started on port 46599
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[2022-11-14 21:53:26.238 - INFO] :shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/@elastic/eui/lib/components/icon/icon.js", :requires [{:line 599, :column 39}]}
[:app] Build failure:
The required namespace "eui.page-content" is not available, it was required by "sample_app/core.cljs".
@vloth
Copy link
Contributor

vloth commented Nov 14, 2022

I think the libraries in the example are just outdated.

I updated the package.json

- "@elastic/eui": "41.2.0",
+ "@elastic/eui": "64.0.0",
+ "@emotion/css": "^11.10.5",
+ "@emotion/react": "^11.10.5",

The deps.edn should be updated too

- co.elastic/eui-cljs {:mvn/version "41.2.0"}
+ co.elastic/eui-cljs {:mvn/version "64.0.0"}

Finally, update the code to reflect the new components.
Page template is now deprecated and shouldn't be used.

src/sample_app/core.cljs

(ns sample-app.core
  (:require  ...
-            [eui.page-content :refer [EuiPageContent]]
-            [eui.page-content-body :refer [EuiPageContentBody]]
+            [eui.page-template :refer [EuiPageTemplate]]
+            [eui.page-section :refer [EuiPageSection]]
...
-       [:> EuiPageContent
-        [:> EuiPageContentBody
+       [:> EuiPageTemplate
+        [:> EuiPageSection
...

Your build should be green now ✅.
@haywoood if these changes looks good, I can raise a PR if helps?

@luminecs
Copy link
Author

@vloth This did solve the problem, thank you very much!!!

@haywoood
Copy link
Contributor

I think the libraries in the example are just outdated.

I updated the package.json

- "@elastic/eui": "41.2.0",
+ "@elastic/eui": "64.0.0",
+ "@emotion/css": "^11.10.5",
+ "@emotion/react": "^11.10.5",

The deps.edn should be updated too

- co.elastic/eui-cljs {:mvn/version "41.2.0"}
+ co.elastic/eui-cljs {:mvn/version "64.0.0"}

Finally, update the code to reflect the new components. Page template is now deprecated and shouldn't be used.

src/sample_app/core.cljs

(ns sample-app.core
  (:require  ...
-            [eui.page-content :refer [EuiPageContent]]
-            [eui.page-content-body :refer [EuiPageContentBody]]
+            [eui.page-template :refer [EuiPageTemplate]]
+            [eui.page-section :refer [EuiPageSection]]
...
-       [:> EuiPageContent
-        [:> EuiPageContentBody
+       [:> EuiPageTemplate
+        [:> EuiPageSection
...

Your build should be green now ✅. @haywoood if these changes looks good, I can raise a PR if helps?

That would be great thank you!

@haywoood haywoood added the bug Something isn't working label Nov 15, 2022
vloth added a commit to vloth/eui-cljs that referenced this issue Nov 16, 2022
Page content was deprecated in favor of a general purpose page template,
or page section [1].
Added peerDependencies as required in the version 64.0.0 [2].
Fixes elastic#38

[1]: elastic/eui#6194
[2]: https://github.com/elastic/eui/blob/v64.0.0/wiki/consuming.md#installation
haywoood pushed a commit that referenced this issue Jan 13, 2023
Page content was deprecated in favor of a general purpose page template,
or page section [1].
Added peerDependencies as required in the version 64.0.0 [2].
Fixes #38

[1]: elastic/eui#6194
[2]: https://github.com/elastic/eui/blob/v64.0.0/wiki/consuming.md#installation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants