Skip to content

dennisjlee/iitm-assign-module-var-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bug report

With import-in-the-middle enabled, I found a bug where assigning to a let variable in a module does not work as expected.

This is a simplified version of what happens in a SvelteKit application, using this module.

I have tested this behavior with Node 20.9.0 and 18.18.2.

Expected behavior

$ npm run test
> iitm-sveltekit-repro@0.0.1 test
> node index.js

setting env, env.FOO is bar
using env from another module, env.FOO is bar

Actual behavior with import-in-the-middle

$ npm run test:iitm

> iitm-sveltekit-repro@0.0.1 test:iitm
> node --experimental-loader import-in-the-middle/hook.mjs index.js

(node:12408) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
setting env, env.FOO is bar
using env from another module, env.FOO is baz

About

Minimal repro for a bug in import-in-the-middle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published