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 import issue in 6.4.x #197
Comments
thanks Sean, just double-checking, this is a typescript error right? |
|
I don't see evidence of it as being the root cause, however. |
hey Sean, I took a look at this, and haven't seen any major changes between versions. Did anything else change on your end? I'd expect others to have the same issue, if the module was borked. You may want to change your |
I have same issue. When I build it with tsc, I got the following error
test.ts is just same as readme typescript example It seems like importing only types not real modules |
thank you @es-lee will look at this today. |
hey, i should admit, I am not a typescript pro like @jecraig is. i could get it working like this, but the typefile no-longer works. import * as spacetime from './'
spacetime().format() gonna dig a little more, but I should admit i'm a little out of my depth here. |
ah, geez {
"compilerOptions": {
"esModuleInterop": true
}
} i'm not sure why this has changed during an update yet. We have an esmodule build which should export the right thing, and not require the interop flag. But I can't get typescript to point at that build for some reason. |
@spencermountain I haven't been able to get a typescript environment that reproduces the issue. If you could let me know what environment you had (or a failing repo) I could possibly look into it more. Regardless, I read through the PR you linked to see if I could find anything. Now I generally regard package making to be complete blackmagic so I might not be the best person to debug it but I noticed you added |
thanks Jacob, this was a clever insight. Thank you. for reference, i'm just trying things, running import spacetime from './'
let d = spacetime('june 5')
console.log(d.format('nice')) |
The error I'm seeing is
Should every: (unit: TimeUnit, end: Spacetime) => Spacetime[]
every: (unit: TimeUnit, end: String) => Spacetime[] just be expressed as From https://github.com/spencermountain/spacetime/blob/master/types/types.d.ts#L59-L61 This is potentially a separate issue. |
@Nfinished I believe this would be a separate issue. I'll have a PR soon. |
I'm getting the following error when I try to run my app after upversioning to 6.4.x
6.3.0 works fine.
have tried importing like
import spacetime from 'spacetime';
and
import { spacetime } from 'spacetime';
have tried a clean wipe of my repo, fresh install with 6.4.x to no avail. Logging spacetime() gives me
/static/media/spacetime.edf1835b.mjs
which makes me think it might be a webpack compatibility issue. Running webpack@3.8.1The text was updated successfully, but these errors were encountered: