Closed antonstefer closed 4 months ago
package.json:
{ "type": "module" "dependencies" : { "spacetime": "7.5.0", "typescript": "5.0.4" } }
tsconfig.json:
{ "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "lib": ["es2023"], "module": "node16", "moduleResolution": "node16" "target": "es2022", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "useUnknownInCatchVariables": false, "noUnusedLocals": true, "resolveJsonModule": true, "outDir": "dist/", "baseUrl": ".", "verbatimModuleSyntax": true }, "exclude": ["node_modules"], }
Importing Spacetime like this:
import type { Spacetime } from 'spacetime' import spacetime from 'spacetime'
produces the following Typescript error:
TS2614: Module '"spacetime"' has no exported member 'Spacetime'. Did you mean to use 'import Spacetime from "spacetime"' instead?
Directly importing from spacetime/types/types like mentioned here does not work as well:
spacetime/types/types
TS2307: Cannot find module 'spacetime/types/types' or its corresponding type declarations.
Is there another way to import the types or is something broken? This syntax has been working when my project was still using CommonJS.
Thank you!
Can you create a small repo that recreates this issue.
Here you go: https://github.com/antonstefer/spacetime-import-issue
Thank you Anton! Will keep this open until it's released, in the next few days. cheers
released as 7.6.0 cheers!
7.6.0
Setup
package.json:
tsconfig.json:
Problem
Importing Spacetime like this:
produces the following Typescript error:
Directly importing from
spacetime/types/types
like mentioned here does not work as well:Is there another way to import the types or is something broken? This syntax has been working when my project was still using CommonJS.
Thank you!