Version
System:
OS: Windows 11 10.0.22631
CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
Memory: 8.66 GB / 31.62 GB
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.22621.3527
Details
I cannot import a config type like EcmaScriptVersion from @rslib/core.
Example:
import { type EcmaScriptVersion } from "@rslib/core";
I get the following error: "Module '"@rslib/core"' has no exported member 'EcmaScriptVersion'.ts(2305)"

Now, If I go into my local node_modules directory and update the source code of the @rslib/core package I can get it to work, byy updating the node_modules/@rslib/core/dist-types/types/index.d.ts file.
Before:
export type * from "./config";
export type * from './utils';
Now:
export type * from './config/index.d.ts';
export type * from './utils';
Now I can import the type:

I am using Typescript 5.5.4 and my tsconfig.json file is:
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"allowImportingTsExtensions": true,
"moduleResolution": "NodeNext",
"module": "NodeNext",
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"strict": true,
"allowJs": true,
"checkJs": false,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"sourceMap": false,
"jsx": "react-jsx"
}
}
Thanks for your help!
Patrick
Reproduce link
https://github.com/patricklafrance/rslib-import-config-types
Reproduce Steps
import { type EcmaScriptVersion } from "@rslib/core";
Version
System: OS: Windows 11 10.0.22631 CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H Memory: 8.66 GB / 31.62 GB Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527Details
I cannot import a config type like
EcmaScriptVersionfrom@rslib/core.Example:
I get the following error: "Module '"@rslib/core"' has no exported member 'EcmaScriptVersion'.ts(2305)"
Now, If I go into my local
node_modulesdirectory and update the source code of the@rslib/corepackage I can get it to work, byy updating thenode_modules/@rslib/core/dist-types/types/index.d.tsfile.Before:
Now:
Now I can import the type:
I am using Typescript
5.5.4and mytsconfig.jsonfile is:{ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "allowImportingTsExtensions": true, "moduleResolution": "NodeNext", "module": "NodeNext", "target": "ESNext", "lib": ["dom", "dom.iterable", "esnext"], "isolatedModules": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "strict": true, "allowJs": true, "checkJs": false, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "sourceMap": false, "jsx": "react-jsx" } }Thanks for your help!
Patrick
Reproduce link
https://github.com/patricklafrance/rslib-import-config-types
Reproduce Steps