Menci / vite-plugin-top-level-await

Transform code to support top-level await in normal browsers for Vite.
MIT License
272 stars 15 forks source link

Error when using with vite 3.2+ #14

Closed JBtje closed 2 years ago

JBtje commented 2 years ago

All is fine when using with vite 3.1.8, however when using 3.2+ the below error triggers while building. This happens only on unix systems...

[vite-plugin-top-level-await] Fallback bindings does not support this interface yet.
error during build:
Error: Fallback bindings does not support this interface yet.
    at Compiler.<anonymous> (/var/www/dev/node_modules/@swc/core/index.js:119:23)
    at Generator.next (<anonymous>)
    at /var/www/dev/node_modules/@swc/core/index.js:34:71
    at new Promise (<anonymous>)
    at __awaiter (/var/www/dev/node_modules/@swc/core/index.js:30:12)
    at Compiler.parse (/var/www/dev/node_modules/@swc/core/index.js:115:16)
    at Object.parse (/var/www/dev/node_modules/@swc/core/index.js:320:21)
    at /var/www/dev/node_modules/vite-plugin-top-level-await/dist/bundle-info.js:33:19
    at Array.map (<anonymous>)
    at parseBundleAsts (/var/www/dev/node_modules/vite-plugin-top-level-await/dist/bundle-info.js:31:78)

node: 16.14.0 npm: 8.19.2

Note: After updating to node: 18.12.1 npm: 9.1.2

the error seems resolved.

brianorwhatever commented 1 year ago

hmm I have updated to node: 'v18.12.1', npm: '9.1.3' and am still running into this issue. this is on an alpine node docker container where my local osx build runs fine. will try other linux envs and see if that fixes it

brianorwhatever commented 1 year ago

@JBtje what OS did you use I am not having much luck..