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

react core build && dev error #10795

Closed
DamnClin opened this issue Sep 8, 2024 · 0 comments · Fixed by #10797
Closed

react core build && dev error #10795

DamnClin opened this issue Sep 8, 2024 · 0 comments · Fixed by #10797

Comments

@DamnClin
Copy link
Collaborator

DamnClin commented Sep 8, 2024

On main, when running npm run build on a react-core application got:

npm run build

> jhipster-sample-application@0.0.0 build
> tsc && vite build --emptyOutDir

✘ [ERROR] "vite-tsconfig-paths" resolved to an ESM file. ESM file cannot be loaded by `require`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details. [plugin externalize-deps]

    node_modules/esbuild/lib/main.js:1225:27:
      1225 │         let result = await callback({
           ╵                            ^

    at file:///tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:66566:23
    at requestCallbacks.on-resolve (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:1225:28)
    at handleRequest (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:647:17)
    at handleIncomingPacket (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:672:7)
    at Socket.readFromStdout (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:600:7)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:66528:18)
    at handlePlugins (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:699:5)
    at /tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:2023:15
    at new Promise (<anonymous>)
    at Object.build (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:2022:25)
    at build (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:1873:51)
    at bundleConfigFile (file:///tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:66483:24)

  The plugin "externalize-deps" was triggered by this import

    vite.config.ts:2:26:
      2 │ import tsconfigPaths from 'vite-tsconfig-paths';~~~~~~~~~~~~~~~~~~~~~

failed to load config from /tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/vite.config.ts
error during build:
Error: Build failed with 1 error:
node_modules/esbuild/lib/main.js:1225:27: ERROR: [plugin: externalize-deps] "vite-tsconfig-paths" resolved to an ESM file. ESM file cannot be loaded by `require`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.
    at failureErrorWithLog (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:1472:15)
    at /tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:945:25
    at runOnEndCallbacks (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:1315:45)
    at buildResponseToResult (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:943:7)
    at /tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:970:16
    at responseCallbacks.<computed> (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:622:9)
    at handleIncomingPacket (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:677:12)
    at Socket.readFromStdout (/tmp/9dfbbae6-b568-45d1-bd38-e70d29cdb962/node_modules/esbuild/lib/main.js:600:7)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)

With:

node --version
v20.17.0

And

npm --version
10.8.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant