Replies: 17 comments
-
This has again bit me, although slightly different. I updated the package Thoughts? @peterblazejewicz @sheetalkamat @jakebailey @sandersn |
Beta Was this translation helpful? Give feedback.
-
tbh I'm using only client (no Node host code, except of a bunch of bundler specific files) nowadays, but I know topic is complex and ships with dedicated detailed page: |
Beta Was this translation helpful? Give feedback.
-
Ah, thanks for the link. It made me check if |
Beta Was this translation helpful? Give feedback.
-
I am not clear what you're describing; is the fix not to just switch the module mode to |
Beta Was this translation helpful? Give feedback.
-
You refer to the It is the opposite. When module is set to |
Beta Was this translation helpful? Give feedback.
-
I was referring to the example in the original issue; happy to look at anything else if they pose a better example. Though, that is a valid error, no? What isn't enforced? (We eventually want every package on DT to use node16 resolution) |
Beta Was this translation helpful? Give feedback.
-
I think it's the same rule as with packages using modules. Relative imports must include the extension. I think it should be enforced by default by DT. |
Beta Was this translation helpful? Give feedback.
-
If a package doesn't have
And this should happen if the tsconfig on DT is changed to have |
Beta Was this translation helpful? Give feedback.
-
I think we're talking past each other. The original example was Form what I can tell, it doesn't matter what we have in Thus, I it seems sensible to me to enforce |
Beta Was this translation helpful? Give feedback.
-
And what I'm trying to say is that because this package has set module=commonjs ( ), this was not caught because the extension was not required. If you flip that tonode16 , you get errors when doing pnpm test rdf-ext , including:
Which are resolved when adding a If a DT package checks in |
Beta Was this translation helpful? Give feedback.
-
Ooooh, how did I never realise that it does actually make a difference for Ok, in such case I shall reformulate my proposal. I think it should be enforced that if the package.json has |
Beta Was this translation helpful? Give feedback.
-
Well ok, I see that
Why is that, actually? Convenience? |
Beta Was this translation helpful? Give feedback.
-
To be clear, we want every package to eventually have
|
Beta Was this translation helpful? Give feedback.
-
Gotcha
Depending on the timeline, maybe it would be possible to only enforce node16 on pull requests. Gradually, at least actively maintained packages would naturally migrate to the desired state |
Beta Was this translation helpful? Give feedback.
-
I think more likely would be for us to enable We're also going to be adding AreTheTypesWrong to DT CI, which will help. |
Beta Was this translation helpful? Give feedback.
-
@tpluscode Tom, you happy with the outcome? Convert to discussion? |
Beta Was this translation helpful? Give feedback.
-
Yes, you can convert to discussion. Thanks |
Beta Was this translation helpful? Give feedback.
-
... when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
I have been fixing multiple packages which show this error in an ESM project with module resolution =
node16
For example: #65918
I think this should be enforced in type packages which are
type: module
in their package.jsonRe #module
Beta Was this translation helpful? Give feedback.
All reactions