gggritso opened a new issue, #21241:
URL: https://github.com/apache/echarts/issues/21241

   ### Version
   
   6.0.0
   
   ### Link to Minimal Reproduction
   
   https://codesandbox.io/p/devbox/xp6t44
   
   ### Steps to Reproduce
   
   1. Open the linked CodeSandbox
   2. Open a new Terminal
   3. Run `node build.js`
   
   ### Current Behavior
   
   Attempting the build results in an import error:
   
   ```
     Import from "echarts/theme/v5.js" to get the file 
"node_modules/echarts/theme/v5.js":
   
       index.js:1:24:
         1 │ import "echarts/theme/v5";
           │                         ^
           ╵                         .js
   
     You can mark the path "echarts/theme/v5" as external to exclude it from 
the bundle, which will
     remove this error and leave the unresolved path in the bundle.
   
   1 error
   /project/workspace/node_modules/esbuild/lib/main.js:1477
     let error = new Error(text);
                 ^
   
   Error: Build failed with 1 error:
   index.js:1:7: ERROR: Could not resolve "echarts/theme/v5"
       at failureErrorWithLog 
(/project/workspace/node_modules/esbuild/lib/main.js:1477:15)
       at /project/workspace/node_modules/esbuild/lib/main.js:946:25
       at /project/workspace/node_modules/esbuild/lib/main.js:898:52
       at buildResponseToResult 
(/project/workspace/node_modules/esbuild/lib/main.js:944:7)
       at /project/workspace/node_modules/esbuild/lib/main.js:971:16
       at responseCallbacks.<computed> 
(/project/workspace/node_modules/esbuild/lib/main.js:623:9)
       at handleIncomingPacket 
(/project/workspace/node_modules/esbuild/lib/main.js:678:12)
       at Socket.readFromStdout 
(/project/workspace/node_modules/esbuild/lib/main.js:601:7)
       at Socket.emit (node:events:518:28)
       at addChunk (node:internal/streams/readable:559:12) {
     errors: [Getter/Setter],
     warnings: [Getter/Setter]
   }
   ```
   
   ### Expected Behavior
   
   I would expect the build to work! It works in other build tools, like 
Rspack. Changing the import path to `"echarts/theme/v5.js";` fixes the error in 
esbuild.
   
   ### Environment
   
   ```markdown
   
   ```
   
   ### Any additional comments?
   
   I believe this is because of the `export` configuration in `package.json`. 
The `theme` wildcards are missing `.js`, I think the export needs to be changed 
to ` "./theme/*": "./theme/*.js",`. Strangely, this fails in esbuild, but not 
in other build tools like Rspack. This is not a major issue and has a simple 
workaround, but I thought it'd be good to report this. Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to