Closed sufianrhazi closed 5 months ago
Hello, how are you buillding & running this code? I can't reproduce the error in NodeJS w/ npx tsx ./test.mts
. Do you have a tsconfig.json
for this code? This code example runs to completion with no errors for me in NodeJS, compiled with this project's tsconfig.json.
It would be helpful to have the final output JS code, and information about the runtime you're using like:
I just published 0.26.1-rc.0
, does that fix the issue for you?
Ah, apologies for not including that in the initial report. This is when executed in a browser (Chrome) and built with vite (esbuild + rollup). I'll get the specific versions to you and check if the new rc
fixes the issue later today.
And I've confirmed that 0.26.1-rc.0
fixes the issue for me, thank you!
And to answer your questions, here's the system info it repros on:
vite/4.4.7 darwin-x64 node-v16.10.0
0.18.17
Version 5.1.6
To run the code, using this vite.config.js
file:
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
base: './',
build: {
assetsDir: './',
target: 'es2020',
},
optimizeDeps: {
exclude: ['quickjs-emscripten'],
},
});
And an example.html
file containing:
<!DOCTYPE html>
<meta charset="UTF-8">
<script type="module" src="./example.ts"></script>
Place the repro script as example.ts
, run the vite dev server and visit /example.html
The following code works as expected in v0.25.1, but fails with an error in v0.26.0:
The error I get when running in v0.26.0 is:
I'm assuming this has to do with the using/dispose support added in 0.26.0, which may not be added to the intrinsic
Promise.resolve()
return value in the context?