Open ceisele-r opened 3 months ago
I suspect this issue is related to your tsconfig.json. Could you paste your tsconfig.json here? A minimal reproduction repository would be better.
@ocavue essentially, this is the tsconfig.json
using typescript 5.5.4:
{
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "./.cache/release.tsbuildinfo",
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"sourceMap": false,
"rootDir": "./src/",
"outDir": "./dist/",
"jsx": "react-jsx",
"allowJs": true,
"noEmit": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strictNullChecks": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strict": true,
"lib": ["ES2022", "dom"],
"resolveJsonModule": true,
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": ["./src/**/*"],
"exclude": ["**/webpack.*.js", "**/webpack*.js", "./cypress/**/*"]
}
I can also try if I can create a minimal repro.
I guess changing moduleResolution
to Bundler
could resolve it according to the docs as this states:
...but unlike the Node.js resolution modes, bundler never requires file extensions on relative paths in imports.
Unfortunately, changing to Bundler is not that easy and probably requires some work on our side before we can validate whether this resolves it.
Summary
When upgrading from remirror v2 to v3, exports from
remirror-extensions
can no longer be resolved correctly:E.g. the following import
resolves the import from
remirror-extensions.d.ts
but inside this file, the export is defined as follows:...and
./_tsup-dts-rollup
cannot be resolved by Typescript even though there is a_tsup-dts-rollup.d.ts
file in the pathnode_modules\remirror\extensions\dist\
If I (for testing purposes) add the
.ts
extension to the import inremirror-extensions.d.ts
like this:...we get 1 file further for type resolution. If I then add the
.ts
extension to the imports innode_modules\@remirror\extension-mention-atom\dist\remirror-extension-mention-atom.d.ts
, the type can correctly be resolved.=> So I guess all imports
from './_tsup-dts-rollup';
in all files should instead befrom './_tsup-dts-rollup.ts';
Steps to reproduce
See above, try to import
and see that the type is not correctly resolved.
Expected results
The Types are correctly resolved.
Actual results
See above.
Possible Solution
=> I guess all imports
from './_tsup-dts-rollup';
should instead befrom './_tsup-dts-rollup.ts';
Screenshot(s)
n/a