An error was reported during the process of runing the project: [ERROR]Could not resolve "a" #238
Unanswered
Henrytudor-lee
asked this question in
Q&A
Replies: 2 comments 1 reply
-
请问这个问题解决了吗 |
Beta Was this translation helpful? Give feedback.
1 reply
-
I have the same problem. Have you solved it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My program is typescript + three.js + vue3 + vite . My operation is as follows:
// terminal
npm i opencascade.js@beta
npm i vite-plugin-wasm
// vite.config.js
import { defineConfig } from 'vite'
import wasm from 'vite-plugin-wasm'
export default defineConfig({
plugins: [
vue(),
wasm()
],
optimizeDeps: {
include: ['file-loader'],
// exclude: ['a']
},
...
})
// main.ts
import initOpenCascade from 'opencascade.js';
...
initOpenCascade().then((oc : OpenCascadeInstance) => {
this.oc = oc;
});
// terminal
npm run dev
// and error
X [ERROR] Could not resolve "a"
You can mark the path "a" as external to exclude it from the bundle, which will remove this error.
D:\fileOrganization\ePro\Cascade_demo\node_modules\esbuild\lib\main.js:1636
let error = new Error(
${text}${summary}
);^
Error: Build failed with 1 error:
vite-plugin-wasm-namespace:D:\fileOrganization\ePro\Cascade_demo\node_modules\opencascade.js\dist\opencascade.full.wasm:43:35151: ERROR: Could not resolve "a"
at failureErrorWithLog (D:\fileOrganization\ePro\Cascade_demo\node_modules\esbuild\lib\main.js:1636:15)
.......
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
{
detail: undefined,
id: '',
location: {
column: 35151,
file: 'vite-plugin-wasm-namespace:D:\fileOrganization\ePro\Cascade_demo\node_modules\opencascade.js\dist\opencascade.full.wasm',
length: 3,
line: 43,
lineText: 'import { a as __vite__wasmImport_0_0, b as __vite__wasmImport_0_1, c as __vite__wasmImport_0_2, d as
........
__vite__wasmImport_0_315, Ue as __vite__wasmImport_0_316, Ve as __vit'... 25155 more
characters,
namespace: '',
suggestion: ''
},
notes: [
{
location: null,
text: 'You can mark the path "a" as external to exclude it from the bundle, which will remove this error.'
}
],
pluginName: '',
text: 'Could not resolve "a"'
}
],
warnings: []
}
Node.js v18.15.0
I don't how to fix it, and I try to get some help from GPT / claude ,but it's not work for this issue with their suggestion.I really hope somebody can help me to fix this , thanks.
Beta Was this translation helpful? Give feedback.
All reactions