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 spacetime from ('spacetime') says undefined #144
Comments
import spacetime from 'spacetime'
says undefined
import spacetime from 'spacetime'
says undefined
@codehatcher Can you paste in your tsconfig |
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"declaration": true,
"outDir": "./dist",
"strict": true,
"sourceMap": true
}
} |
Ok, so I think this is just an issue with the way your typescript is configured. You've got commonjs which uses const x = require('y') which overrides with the es6 import syntax (typescripts default syntax) import x from 'y' So either remove the module option from your tsconfig or just continue using the commonjs require syntax. I don't think there's any issues with spacetime though. |
I appreciate you troubleshooting this with me @jecraig, I changed the tsconfig as you suggested and now get a slightly different error I tried one where I switched to the following tsconfig.json {
"compilerOptions": {
"target": "es6",
"module": "es6",
"declaration": true,
"outDir": "./dist",
"strict": true,
"sourceMap": true
}
} |
As i'm looking through these test cases I see there is nothing that uses the typescript non-relative resolution via a string literal e.g. |
I scratched up a quick project and there do appear to be some issues using the typings without a bundler. I've been using Spacetime with Webpack no problem. I'll try looking into some solutions for using it without a bundler. |
version |
I'm relatively new to typescript by my other dependencies are working ok. I have the following error when using this module import method
but no error when using this method
my tslinter is complaining about the 2nd one but other than that it is working. something you may want to look into, not sure if it's specific to me
The text was updated successfully, but these errors were encountered: