-
Notifications
You must be signed in to change notification settings - Fork 208
require("glamorous").default undefined? #89
Comments
Ah, that's interesting that TypeScript does that... 🤔 So here's the deal with our various dist files. The |
I'm not sure what can be done. Either there's something wrong with the Typescript definition or Typescript itself. Looking through SO, I found this, which is very similar to this case. Edited: But the proposed solution on SO doesn't seem like a valid ES6 import statement |
Feel free to open a PR to update whatever we need to so we can support TypeScript well! |
having the same issue with typescript. solution is to use require instead of import, but you lose autocomplete and it looks ugly next to all your imports. |
Are you all using webpack? |
I know I have been having problems with this some time ago (because of some different library). I solved it by compiling typescript to ES6 (with ES modules - no CJS), running through Babel and finally through Webpack (of course using ts-loader and babel-loader). I'm using it since them and got no problems 😃. In my opinion it is better solution for now than importing using require. If anyone needs help with this, I can share my webpack.config.js, .babelrc and tsconfig.json 😉. |
@dragosbulugean you're using @kentcdodds you mean to bundle the package? or consuming the package? @ErikCupal that's what I'm doing right now. How are you dealing with type definitions? BTW, do you think that there could be a mistake on how we do exports in the type definitions that is causing this problem? |
@kentcdodds I am using fuse-box |
Just looking into this as have started seeing it on one of our server side renders. A "solution" could be something as simple as I'll open a PR up shortly. Related Rollup issue: |
I just wanna make a note here for any future reference. For those who encounter this problem, please make sure that |
* Add root quill editor * Improvements - Typescript syntax - DefinitelyTyped 2.0 syntax - Add new Quill experimental API * Fix namespace error
glamorous
version: 3.11.1glamor
version: 2.20.4react
version: 15.5.4What you did:
I'm creating an UI component package written in Typescript.
What happened:
The UI component is written in ES6. Then Typescript compiles ES6 code to ES5. But it throws error when using the package.
Here's the compiled ES5 code:
Problem description:
The error says that
glamorous.default
isundefined
The text was updated successfully, but these errors were encountered: