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

Type: module and other esm implications #51

Open
tcodes0 opened this issue Jun 26, 2020 · 1 comment
Open

Type: module and other esm implications #51

tcodes0 opened this issue Jun 26, 2020 · 1 comment

Comments

@tcodes0
Copy link

tcodes0 commented Jun 26, 2020

This library is really useful. It's like a missing piece to my REPL setup that allows me to reload code on filesystem events. I recently moved my code to esm using node's new type: module field in package.json. I'm also using ts-node which has WIP support for esm code loading.

The issue is that in my setup with latest node and esm, decache apparently doesn't work. Would it help to provide a code sandbox demo? I realize it could very well be ts-node or another piece of the puzzle not working. 🤔

to clarify: I'm also using typescript lol. And instead of require I write import (kinda obvious but just want to make sure we're on the same page here)

@tcodes0
Copy link
Author

tcodes0 commented Jun 28, 2020

Did some digging on this. I think we are missing a require.cache equivalent on esm.
Related: https://stackoverflow.com/questions/51498129/require-cache-equivalent-in-es-modules
Related: nodejs/help#2806

repro: https://github.com/Thomazella/esm-repl-reload-repro

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

No branches or pull requests

1 participant