You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -d --rm -it -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=db -ePOSTGRES_USER=postgres -p 5433:5432 --name pg postgres:14.6-alpine3.17
npm install
# 1) This works ...set -a &&source ./.env && ts-node src/foo.ts
# 2) ... but this, inside ts-node REPL, does NOT:> foo = await import('./src/foo.ts')
How can an ESM module imported? I'd be grateful for any variation (await import, import foo from ..., etc.) as long as I get to keep "type": "module" in package.json.
(I've already also asked on StackOverflow with my attempts more fully written out; though the repro project fully encompasses my issue.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here's a quickly reproducible sample repo:
How can an ESM module imported? I'd be grateful for any variation (
await import
,import foo from ...
, etc.) as long as I get to keep"type": "module"
inpackage.json
.(I've already also asked on StackOverflow with my attempts more fully written out; though the repro project fully encompasses my issue.)
Beta Was this translation helpful? Give feedback.
All reactions