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

[BUG] Cannot find module 'ts-node' from 'parser.js' #699

Closed
KalinaMatysiak opened this issue Oct 13, 2022 · 1 comment
Closed

[BUG] Cannot find module 'ts-node' from 'parser.js' #699

KalinaMatysiak opened this issue Oct 13, 2022 · 1 comment

Comments

@KalinaMatysiak
Copy link

Describe the bug
During the run test in jest, I get an error "Cannot find module 'ts-node' from 'parser.js'". I figure out the problem disappears when I commented on these lines in parser.js file.

image

It appears, that:

  1. the require.extensions is deprecated
  2. the require.extensions object has only the following keys: .js, .json, .node. It doesn't have the .ts key

Tests and src codebase is in typescript, including config files.

Expected behavior
A clear and concise description of what you expected to happen.

Please tell us about your environment:

  • node-config version: 3.3.6
  • node-version: 16.16.0
  • ts-node version: 10.9.1

Other information

@markstos
Copy link
Collaborator

markstos commented Aug 4, 2023

Other people are not reporting this problem outside of Jest, so it's not clear it's a node-config bug.

Yes, require.extensions is deprecated, but no one has proposed a better solution here.

There seem to be competing ways of loading TypeScript files. Some more related discussion is here: #530

Considering there's been no activity here since last October, it seems the issue may be isolated to how Jest is loading node-config and not a general problem, so I'm closing this.

A PR to improve the situation is still welcome.

@markstos markstos closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants