Skip to content

Conversation

@craigphicks
Copy link

@craigphicks craigphicks commented May 4, 2022

@sheetalkamat -

Re your pull #48889

I created a test to check the value of impliedNodeFormat from inside a transformer when

  • tsconfig:module is set to "Node12", and
  • package.json exists and type is "commonjs"

I expected that impliedNodeFormat would be ModuleKind.CommonJS. However it is currently undefined,
so the test will not pass.

I know there a good chance that I am misunderstanding how it should work.
If you can help me I would greatly appreciate it.

I created a new test borrowing from src/testRunner/unittests/tsbuildWatch/publicApi.ts
It is src/testRunner/unittests/tsbuildWatch/publicApiImpliedNodeFormat.ts

I has additional file shared/package.json:

{
                name:"shared",
                version:"1.0.0",
                type:"commonjs",
}

that is added to the list passed to createWatchedSystem.

I also added internal getModuleResolutionCache() to SolutionBuilder just to see what was in it, and it is just an empty object {}. Is that correct?

@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 4, 2022
@craigphicks craigphicks closed this May 4, 2022
@craigphicks craigphicks reopened this May 4, 2022
@craigphicks
Copy link
Author

Compiler options not set correctly. Closing.

@craigphicks craigphicks closed this May 4, 2022
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants