-
Notifications
You must be signed in to change notification settings - Fork 122
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
[BUG] Import Issue version 3.0.0-beta.5: "Cannot find module '../api/_core/index" #851
Comments
Moving this to opensearch-js. |
I have the same problem with the search method in the latest version of Next.js API.
|
Investigating. I suspect that it's webpack's handling of lazy loading. |
From what I've gathered, it's not possible to lazy load relative paths in webpack without turning |
We're having the same issue with esbuild, cf https://esbuild.github.io/api/#glob |
Thanks everyone! 3.0.0-beta.6 has been released which removed lazy loading and every I've tested it locally with webpack, please lemme know if this version also resolves the issue for other frameworks as well. |
This should be resolved, closing. |
Describe the bug
Version 3.0.0-beta.5 of @opensearch-project/opensearch has an import error when building with webpack-cli version 1.5.4. Below is the error I received when attempting to build my project:
WARNING in ./node_modules/@opensearch-project/opensearch/api/utils.js 65:36-49
Critical dependency: the request of a dependency is an expression
@ ./node_modules/@opensearch-project/opensearch/lib/OpenSearchAPI.js 18:32-55
@ ./node_modules/@opensearch-project/opensearch/lib/Client.js 49:22-48
@ ./node_modules/@opensearch-project/opensearch/index.js 32:19-42
@ ./src/services/getEsClient.ts 7:21-62
@ ./src/lambda/metricsGatherer.ts 10:22-56
WARNING in ./node_modules/@opensearch-project/opensearch/lib/OpenSearchAPI.js 28:26-39
Critical dependency: the request of a dependency is an expression
@ ./node_modules/@opensearch-project/opensearch/lib/Client.js 49:22-48
@ ./node_modules/@opensearch-project/opensearch/index.js 32:19-42
@ ./src/services/getEsClient.ts 7:21-62
@ ./src/lambda/metricsGatherer.ts 10:22-56
Below is the error I received when attempting to execute code in an AWS Lambda:
{
"errorType": "Error",
"errorMessage": "Cannot find module '../api/_core/index'",
"code": "MODULE_NOT_FOUND",
"stack": [
"Error: Cannot find module '../api/_core/index'",
" at t (/var/task/app.js:2:268736)",
" at E.index (/var/task/app.js:2:268342)",
" at /var/task/app.js:2:511081",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async Promise.all (index 0)",
" at async u.handler (/var/task/app.js:2:510307)"
]
}
This error does not exist in @openseaerch-projejct/opensearch 2.11.0
Related component
Build
To Reproduce
This is not exact
Expected behavior
build will compile with warning: Critical dependency: the request of a dependency is an expression
Additional Details
No response
The text was updated successfully, but these errors were encountered: