-
Notifications
You must be signed in to change notification settings - Fork 102
Importing ts file with .js specifier from .mjs in another workspace fails #334
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
Node.js v20, both jiti v1 + v2
Reproduction
Please see https://stackblitz.com/edit/stackblitz-starters-zwqrgl?file=playwright.config.mjs
npx jiti playwright.config.mjs
Issue happens in both jiti v1 and v2. Cannot find module, but should print { hello: 1 }
First I'd like to know if you think this should even work. If so, I'm happy to look into fix & send PR.
Describe the bug
Not sure if this is even supposed to work: import with .js extensions in specifier which is actually a .ts file and in a workspace dir with type: "module". Relevant bits (minimized in repro):
- https://github.com/argos-ci/argos/blob/main/playwright.config.mjs
- https://github.com/argos-ci/argos/blob/main/apps/backend/src/config/index.ts
- https://github.com/argos-ci/argos/blob/main/apps/backend/package.json#L5
Apparently Playwright's using something that's able to load it all up.
Additional context
No response
Logs
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working