Giter Site home page Giter Site logo

Comments (4)

justjake avatar justjake commented on June 10, 2024

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:

  • OS
  • Package manager
  • Bundler (if any)
  • Browser / NodeJS version
  • How you import / run the code

from quickjs-emscripten.

justjake avatar justjake commented on June 10, 2024

I just published 0.26.1-rc.0, does that fix the issue for you?

from quickjs-emscripten.

sufianrhazi avatar sufianrhazi commented on June 10, 2024

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.

from quickjs-emscripten.

sufianrhazi avatar sufianrhazi commented on June 10, 2024

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:

  • On an Intel MacOS system running Monterey 12.7.2
  • vite: vite/4.4.7 darwin-x64 node-v16.10.0
  • esbuild: 0.18.17
  • tsc: 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

from quickjs-emscripten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.