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

Bindings not found #25

Closed
uni-parse opened this issue Feb 25, 2023 · 20 comments
Closed

Bindings not found #25

uni-parse opened this issue Feb 25, 2023 · 20 comments

Comments

@uni-parse
Copy link

in windows 10 evrything works fine, but in windows 11 I have this error even if main.js are empty in new project

$ pnpm build

> [email protected] build C:\Users\UniParse\projects\test
> vite build

vite v4.1.4 building for production...
✓ 3 modules transformed.
rendering chunks (1)...[vite-plugin-top-level-await] Bindings not found.
error during build:
Error: Bindings not found.
    at Compiler. (C:\Users\UniParse\projects\test\node_modules\.pnpm\@[email protected]\node_modules\@swc\core\index.js:122:23)
    at Generator.next ()
    at C:\Users\UniParse\projects\test\node_modules\.pnpm\@[email protected]\node_modules\@swc\core\index.js:34:71
    at new Promise ()
    at __awaiter (C:\Users\UniParse\projects\test\node_modules\.pnpm\@[email protected]\node_modules\@swc\core\index.js:30:12)
    at Compiler.parse (C:\Users\UniParse\projects\test\node_modules\.pnpm\@[email protected]\node_modules\@swc\core\index.js:115:16)
    at Object.parse (C:\Users\UniParse\projects\test\node_modules\.pnpm\@[email protected]\node_modules\@swc\core\index.js:320:21)
    at C:\Users\UniParse\projects\test\node_modules\.pnpm\[email protected][email protected]\node_modules\vite-plugin-top-level-await\dist\bundle-info.js:33:19
    at Array.map ()
    at parseBundleAsts (C:\Users\UniParse\projects\test\node_modules\.pnpm\[email protected][email protected]\node_modules\vite-plugin-top-level-await\dist\bundle-info.js:31:78)
 ELIFECYCLE  Command failed with exit code 1.
@uni-parse
Copy link
Author

my vite config:

import { defineConfig } from 'vite'
import topLevelAwait from 'vite-plugin-top-level-await'

export default defineConfig({
  base: './',
  plugins: [
    topLevelAwait({
      promiseExportName: "__tla",
      promiseImportName: i => `__tla_${i}`
    })
  ]
})

@Menci
Copy link
Owner

Menci commented Feb 25, 2023

Did you tried removing node_modules and reinstalling dependencies?

@uni-parse
Copy link
Author

thanks for your answer @Menci ,
but I still have this error after removing node_modules & reinstalling,
I even tried to downgrade to differ minor versions 1.3.0 1.2.4 1.1.1 1.0.1

for now I back to use the asyc IIFE wrapper (async ()=>{})();

@changhr2013
Copy link

I got the same error in centos7, but it works fine in mac os.

@uni-parse
Copy link
Author

I don't know why, but its works just fine now!!
I just reinstalled it pnpm add -D vite-plugin-top-level-await

@Menci
Copy link
Owner

Menci commented Mar 17, 2023

I did't do anything about it. Strange...

@uni-parse
Copy link
Author

uni-parse commented Mar 24, 2023

I have reopened the issue again !!
my bad, i was thinking that i did pnpm build, but I didn't !!
now I still have the same issue.

@uni-parse uni-parse reopened this Mar 24, 2023
@Menci
Copy link
Owner

Menci commented May 20, 2023

Hi. Let's continue investigate on this. How can I reproduce it?

Could you try reproduce it with a simple project in a (reproducable, e.g. Docker) environment?

1 similar comment
@Menci
Copy link
Owner

Menci commented May 20, 2023

Hi. Let's continue investigate on this. How can I reproduce it?

Could you try reproduce it with a simple project in a (reproducable, e.g. Docker) environment?

@SAY-yes
Copy link

SAY-yes commented May 26, 2023

I have the same error.
OS win10
node v18.16.0
npm 9.5.1

"react": "^18.2.0"
"vite": "^3.0.7"
"vite-plugin-top-level-await": "^1.2.1"

my config is same as TheUniParse
npm start, it works well.
but build it, it has error.

Error Information:

> [email protected] build
> tsc && vite build

vite v3.2.6 building for production...
✓ 3012 modules transformed.
rendering chunks (1)...[vite-plugin-top-level-await] Bindings not found.

PWA v0.13.3
mode      generateSW
precache  2 entries (1.46 KiB)
files generated
  dist\sw.js
  dist\workbox-c0ce6236.js
error during build:
Error: Bindings not found.
    at Compiler.<anonymous> (E:\xx\xx\node_modules\@swc\core\index.js:122:23)
    at Generator.next (<anonymous>)
    at E:\xx\xx\node_modules\@swc\core\index.:71
    at new Promise (<anonymous>)
    at __awaiter (E:\xx\xx\node_modules\@swc\index.js:30:12)
    at Compiler.parse (E:\xx\xx\node_modules\core\index.js:115:16)
    at Object.parse (E:\xx\xx\node_modules\@sre\index.js:320:21)
    at E:\xx\xx\node_modules\vite-plugin-top--await\dist\bundle-info.js:33:19
    at Array.map (<anonymous>)
    at parseBundleAsts (E:\xx\xx\node_modules\vite-plugin-top-level-await\dist\bundle-info.js:31:78)
    at Object.generateBundle (E:\xx\xx\node_modules\vite-plugin-top-level-await\dist\index.js:86:72)
    at file:///E:/xx/xx/node_modules/rollup/dist/es/shared/rollup.js:22748:40

@uni-parse
Copy link
Author

Hi. Let's continue investigate on this. How can I reproduce it?

Could you try reproduce it with a simple project in a (reproducable, e.g. Docker) environment?

Hi @Menci

unfortunately I lost access to my old environment (official windows 11)
now I'm using unofficial windows11
its custom build without windows defender
now everything works, pnpm build && pnpm preview, no errors

@uni-parse uni-parse closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2023
@HeeBooo
Copy link

HeeBooo commented Jun 20, 2023

The same problem happened to me. May I ask how you solved it? @TheUniParse

@uni-parse
Copy link
Author

Hi @HeeBooo

I don't think I solved anything in particular
and I think the problem has direct relationship with windows defender
I just installed unofficial windows11, which does not have windows defender

@KekekeLi
Copy link

KekekeLi commented Nov 6, 2023

i have the same problem, and it still troubles me

@zyq0407
Copy link

zyq0407 commented Nov 15, 2023

I had the same problem and solved it. I found that the '@swc/core-linux-x64-gnu' module was not found, so, I added to the package.json and reinstalling dependencies.

Dependencies of swc/core in different systems,my vite-plugin-top-level-await version is 1.3.1
"@swc/core-win32-x64-msvc": "1.3.68",
"@swc/core-darwin-x64": "1.3.68",
"@swc/core-linux-x64-gnu": "1.3.68",
"@swc/core-linux-x64-musl": "1.3.68",
"@swc/core-win32-ia32-msvc": "1.3.68",
"@swc/core-linux-arm64-gnu": "1.3.68",
"@swc/core-linux-arm-gnueabihf": "1.3.68",
"@swc/core-darwin-arm64": "1.3.68",
"@swc/core-linux-arm64-musl": "1.3.68",
"@swc/core-win32-arm64-msvc": "1.3.68"

@DMOAbove
Copy link

Same issue on my side. I am able to run fine on my windows machine but when building through github actions it explodes

@farmaazon
Copy link

farmaazon commented Feb 13, 2024

Same issue on my side. I am able to run fine on my windows machine but when building through github actions it explodes

I have exactly the same problem. Are there any plans to fix this?

mergify bot pushed a commit to enso-org/enso that referenced this issue Feb 14, 2024
We've used the vite-plugin-top-level-await to support top level await. But most of them were removed anyway, because the ide-desktop/lib/client is bundled as CJS and use some of gui2 code. And the plugin [is causing problems](Menci/vite-plugin-top-level-await#25), [also in our CI](https://github.com/enso-org/enso/actions/runs/7842841953/job/21402194728?pr=9013#step:8:458)
@Jiachenglong2518
Copy link

@DMOAbove me too, May I ask if you have resolved it

@Jiachenglong2518
Copy link

I had the same problem and solved it. I found that the '@swc/core-linux-x64-gnu' module was not found, so, I added to the package.json and reinstalling dependencies.

Dependencies of swc/core in different systems,my vite-plugin-top-level-await version is 1.3.1 "@swc/core-win32-x64-msvc": "1.3.68", "@swc/core-darwin-x64": "1.3.68", "@swc/core-linux-x64-gnu": "1.3.68", "@swc/core-linux-x64-musl": "1.3.68", "@swc/core-win32-ia32-msvc": "1.3.68", "@swc/core-linux-arm64-gnu": "1.3.68", "@swc/core-linux-arm-gnueabihf": "1.3.68", "@swc/core-darwin-arm64": "1.3.68", "@swc/core-linux-arm64-musl": "1.3.68", "@swc/core-win32-arm64-msvc": "1.3.68"

I had the same problem and solved it. I found that the '@swc/core-linux-x64-gnu' module was not found, so, I added to the package.json and reinstalling dependencies.

Dependencies of swc/core in different systems,my vite-plugin-top-level-await version is 1.3.1 "@swc/core-win32-x64-msvc": "1.3.68", "@swc/core-darwin-x64": "1.3.68", "@swc/core-linux-x64-gnu": "1.3.68", "@swc/core-linux-x64-musl": "1.3.68", "@swc/core-win32-ia32-msvc": "1.3.68", "@swc/core-linux-arm64-gnu": "1.3.68", "@swc/core-linux-arm-gnueabihf": "1.3.68", "@swc/core-darwin-arm64": "1.3.68", "@swc/core-linux-arm64-musl": "1.3.68", "@swc/core-win32-arm64-msvc": "1.3.68"

I had the same problem and solved it. I found that the '@swc/core-linux-x64-gnu' module was not found, so, I added to the package.json and reinstalling dependencies.

Dependencies of swc/core in different systems,my vite-plugin-top-level-await version is 1.3.1 "@swc/core-win32-x64-msvc": "1.3.68", "@swc/core-darwin-x64": "1.3.68", "@swc/core-linux-x64-gnu": "1.3.68", "@swc/core-linux-x64-musl": "1.3.68", "@swc/core-win32-ia32-msvc": "1.3.68", "@swc/core-linux-arm64-gnu": "1.3.68", "@swc/core-linux-arm-gnueabihf": "1.3.68", "@swc/core-darwin-arm64": "1.3.68", "@swc/core-linux-arm64-musl": "1.3.68", "@swc/core-win32-arm64-msvc": "1.3.68"

@zyq0407 Your posting method solves my problem

@asyncTime
Copy link

hello, how you solved it?

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

No branches or pull requests