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

[ERROR] With statements cannot be used with the "esm" output format due to strict mode #8889

Closed
7 tasks done
58bcbedf47bd91439c opened this issue Jul 2, 2022 · 4 comments
Closed
7 tasks done
Labels
wontfix This will not be worked on

Comments

@58bcbedf47bd91439c
Copy link

58bcbedf47bd91439c commented Jul 2, 2022

Describe the bug

npm run dev ‘start fail’
Snipaste_2022-07-04_14-12-51

run : vite build --mode build

Reproduction

https://stackblitz.com/edit/vitejs-vite-zjizma?file=src/App.vue

System Info

System:
    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 91.90 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.14.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.3.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Safari: 15.1

Used Package Manager

npm

Logs

No response

Validations

@github-actions
Copy link

github-actions bot commented Jul 3, 2022

Hello @763139102. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@58bcbedf47bd91439c
Copy link
Author

58bcbedf47bd91439c commented Jul 4, 2022

你好@763139102. 请使用 GitHub 存储库或StackBlitz提供最小复制。如果在 3 天内没有任何活动,标有 的问题将被关闭。need reproduction

https://stackblitz.com/edit/vitejs-vite-zjizma?file=src/App.vue
Vitejs - Vite (forked) - StackBlitz

@sapphi-red
Copy link
Member

I think this is something we could not support due to the limitation of ESM.
Vite transpiles CJS into ESM. CJS could be sloppy mode (non-strict mode) so with could be used. But ESM is always strict mode so with needs to be transpiled.
But transpiling with is very difficult.

@bluwy
Copy link
Member

bluwy commented Jul 10, 2022

I second sapphi too. html-docx-js should try to remove with usage if it's to be used in ESM, otherwise the only other way is to load html-docx-js from a CDN like https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.js and via script tag so you can access it via window.htmlDocx. Closing as this won't be supported in Vite.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2022
@sapphi-red sapphi-red added wontfix This will not be worked on and removed pending triage labels Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants