Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typescript] Could not find declaration file for module 'spacetime' #356

Closed
abetoots opened this issue Dec 7, 2022 · 7 comments
Closed
Labels

Comments

@abetoots
Copy link

abetoots commented Dec 7, 2022

Could not find declaration file for module 'spacetime' when using moduleResolution: 'NodeNext' or "Node16".

TS version: 4.9.3
Spacetime version: 7.2.0

@spencermountain
Copy link
Owner

hey Abe, I may need more information about your build setup.
I'm afraid i'm not very sharp at typescript details. From what I understand, the typefile is linked in spacetime properly.
let me know if you have any suggestions
cheers

@the-sky-is-pink
Copy link

Hey , is there any solution for this ?

@folkg
Copy link

folkg commented Jun 11, 2023

I'm having the same issue. I solved it with a workaround.

I created a spacetime.d.ts in my src directory, and I simply added this line:

declare module "spacetime";

@spencermountain
Copy link
Owner

hey @jecraig - you know anything about nodeNext?
happy to make any changes, would love some help.

@jecraig
Copy link
Contributor

jecraig commented Jun 12, 2023

I don't know of any issues, but I'll take a look

@jecraig
Copy link
Contributor

jecraig commented Jun 17, 2023

@spencermountain Ok, so I don't have a fix for this, but it looks like it's just an issue with our package.json. Here's a demo that reproduces the issue.

https://github.com/jecraig/Spacetime356Test

I changed the package.json to this and it worked for the project, but your rollup failed to run.

{
"name": "spacetime",
"version": "7.4.4",
"description": "figure-out dates across timezones",
"unpkg": "builds/spacetime.min.js",
"main": "src/index.js",
"module": "./src/index.js",
"es2015": "./src/index.js",
"types": "types/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"types": "./types/index.d.ts",
"require": "./builds/spacetime.cjs",
"default": "./src/index.js"
}
}

I'll try playing with it more after the weekend, but this is what I've discovered so far.

@spencermountain
Copy link
Owner

should be fixed now in 7.4.5 - let me know if you see any other funny business.
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants