You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/06/09 09:42:11 UTC
[GitHub] [echarts] kingyue737 opened a new issue, #17189: [Bug] Support dual packaging
kingyue737 opened a new issue, #17189:
URL: https://github.com/apache/echarts/issues/17189
### Version
5.3.2
### Link to Minimal Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-kcuvdv
### Steps to Reproduce
1. Open the link
2. Wait for the test to end
### Current Behavior
Vitest throw the following error:
```
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL test/echarts.test.ts [ test/echarts.test.ts ]
SyntaxError: Cannot use import statement outside a module
❯ Object.compileFunction https:/vitest-dev-vitest-kcuvdv.w.staticblitz.com/blitz.ad37e903755d89e0f5d9999e69be73a0c6cb6bcc.js:6:341311
❯ wrapSafe https:/vitest-dev-vitest-kcuvdv.w.staticblitz.com/blitz.ad37e903755d89e0f5d9999e69be73a0c6cb6bcc.js:6:218270
❯ Module._compile https:/vitest-dev-vitest-kcuvdv.w.staticblitz.com/blitz.ad37e903755d89e0f5d9999e69be73a0c6cb6bcc.js:6:218638
❯ Module._extensions..js https:/vitest-dev-vitest-kcuvdv.w.staticblitz.com/blitz.ad37e903755d89e0f5d9999e69be73a0c6cb6bcc.js:6:219666
❯ Module.load https:/vitest-dev-vitest-kcuvdv.w.staticblitz.com/blitz.ad37e903755d89e0f5d9999e69be73a0c6cb6bcc.js:6:217692
❯ Module._load https:/vitest-dev-vitest-kcuvdv.w.staticblitz.com/blitz.ad37e903755d89e0f5d9999e69be73a0c6cb6bcc.js:6:215263
Module /home/projects/vitest-dev-vitest-kcuvdv/node_modules/echarts/lib/core/echarts.js:26 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "echarts" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.
As a temporary workaround you can try to inline the package by updating your config:
// vitest.config.js
export default {
test: {
deps: {
inline: [
"echarts"
]
}
}
}
```
### Expected Behavior
ECharts should be imported correctly as an ES Module by vitest.
ECharts may need to support dual packaging mentioned in [this guide](https://github.com/sheremet-va/dual-packaging).
### Environment
```markdown
- OS: Windows 11
- Browser: Chrome
- Framework: Vue@2 + Vite
Reproduction with `vue-echarts` here: [stackblitz.com/edit/vitest-dev-vitest-fhmvl9](stackblitz.com/edit/vitest-dev-vitest-fhmvl9)
```
### Any additional comments?
This issue has been mentioned before in #16599 but is closed now.
See also the comments of `vitest` member:
https://github.com/ecomfe/vue-echarts/issues/601#issuecomment-1150797371
https://github.com/vitest-dev/vitest/issues/1452#issuecomment-1150750725
--
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-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Support dual packaging [echarts]
Posted by "100pah (via GitHub)" <gi...@apache.org>.
100pah commented on issue #17189:
URL: https://github.com/apache/echarts/issues/17189#issuecomment-1903920938
Closed by #19513
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Support dual packaging [echarts]
Posted by "100pah (via GitHub)" <gi...@apache.org>.
100pah closed issue #17189: [Bug] Support dual packaging
URL: https://github.com/apache/echarts/issues/17189
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] sabifa commented on issue #17189: [Bug] Support dual packaging
Posted by "sabifa (via GitHub)" <gi...@apache.org>.
sabifa commented on issue #17189:
URL: https://github.com/apache/echarts/issues/17189#issuecomment-1538044836
Same issue here, any update?
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] iKnowMagic commented on issue #17189: [Bug] Support dual packaging
Posted by "iKnowMagic (via GitHub)" <gi...@apache.org>.
iKnowMagic commented on issue #17189:
URL: https://github.com/apache/echarts/issues/17189#issuecomment-1512101757
I am having the same error. :(
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org