script.ts with the content console.log('hello').main.ts with the following content:while(true) {
const worker = new Worker('./script.ts', {type: 'module'})
await new Promise(resolve => setTimeout(resolve, 1000))
worker.terminate()
}
deno run --allow-read main.ts.script.ts to console.log('bye') and save it.The subsequent log of deno run --allow-read main.ts should be bye.
After step 4, the subsequent log of deno run --allow-read main.ts is still hello.
macOS Catalina (v10.15.4)
$ deno --version
deno 1.0.5
v8 8.4.300
typescript 3.9.2
No, this is happening on every version of Deno since v1.0.0 until v1.0.5.
Thanks for the report. I guess it's related to our module cache - it should be bypassed for dynamic loads (Worker constructors and dynamic imports).
@bartlomieju what do you think?
Yes, this is the same problem as in #5631 and #4743
While it hasn't fixed #5631 and #4743, I believe the compiler refactor has fixed this one, but I need to create a test to validate that.
I just tried the reproduction with 1.5.2 and it works as expected.
Sorry - I didn't understand the example correctly. This is still a bug.
Most helpful comment
Thanks for the report. I guess it's related to our module cache - it should be bypassed for dynamic loads (Worker constructors and dynamic imports).
@bartlomieju what do you think?