-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Bug] import_coloris.default.init is not a function #59
Comments
Are you using the latest version |
Yes
Small project, here is the package.json
|
@blutorange this cropped up again but all of our tests are passing where you basically check this. |
The last time this happened we added this test case which runs on build: https://github.com/melloware/coloris-npm/blob/main/test-npm/webpack-ts/src/index.ts |
Is there any manual configuration I can try to help find out the problem ? |
The test works because of this entry in the {
"compilerOptions": {
"allowSyntheticDefaultImports": true,
}
} The UMD wrapper has
where Can't quite remember why we didn't make that |
I think it may have been (at least partially) due to AMD / requirejs support. At any rate, changing that right now would probably result in issues for people already using this lib. So for now, I'd say we should just update the docs and re-evaluate whether we want to change the module wrapper with the next major release of Coloris. |
I am ok with breaking this wrapper to get it right. We only have about 80 downloads a week and increasing each month. Better to fix it for good sooner than later? |
Hmm ok, but I need to think about whether that is right or not. Default exports are a problem by themselves and may work differently depending on the bundler / module system. I might have some time during the next few days. I guess we should start by adding more a few tests with webpack and other bundlers, with / without TS. |
Ok no worries. You are the expert! |
Hi, thanks for your work but it is still not working. Even with: import "@melloware/coloris/dist/coloris.css";
import { coloris, init } from "@melloware/coloris";
init();
coloris({el: "#coloris"}); |
@jjf21 Could you share a simple project that illustrates the issue? Might be specific to whatever bundler etc. you are using. Also, did you test against the current version in this github repo since I believe there was no release yet with the change (so the |
I uploaded version 0.10.4-rc1 to npm if you want to try. |
In fact I tried it with
using Thanks for your help ! |
I have same kind of errors as #13
Just by adding
I have the error:
Using CDN is working properly, am I missing something ?
The text was updated successfully, but these errors were encountered: