-
Notifications
You must be signed in to change notification settings - Fork 301
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
Angular 7 : tributejs_1.default is not a constructor #273
Comments
i'm making an Angular 7 project and i use tributejs. i put this in my TS file:
and i have this error
|
Hi @jujupec, how do you import it in your project (the |
Typescript is currently broken not just for angular, but for all typescript. |
Hi @dessalines,
I doubt that. |
In general the code is not specific to Angular. What you to do is to check how you import See https://github.com/zurb/tribute/blob/master/src/index.js#L6 |
Just doing:
Doing |
I think it makes no difference if it is normal ES6 or TypeScript. Generally it should work. The typings file should be also correct. Can you share some sort of codepen so we can reproduce it? |
Issue also reproducing in stackblitz sample. Please give the solution |
|
Sorry but I see a different error there, This may be because of line 7 at https://unpkg.com/browse/tributejs@3.7.2/dist/index.js but there is no |
Try |
You can see the problem here. There are build files with uppercase letters and build files which reference the ones with the uppercase characters. https://github.com/zurb/tribute/tree/master/dist The This is a general problem with the build setup (and |
Also related: #312 |
I couldn't not reproduce the above issue in any stackblitz or codepen samples When I am trying to run locally the error has been occured.I have shared the code snippets of this issue. default.html default.ts
When I compiling the above ts file the following javascript file has generated with .default extension
Finally throws a console error |
Please try the recommended solution using the |
@DanielRuf thanks! That does seem to work for ES6, even though I still get "could not find declaration file" warnings for the typings. |
@DanielRuf Did your PR help with this issue? I just released |
Generally the dist files are the transpiled modules - which is ES5. For ES6 you need the src files. Default is dist. The initial issue was not reproduced by the reporter. At least StackBlitz shows another issue. In your case might have referenced old files from there. |
I think we should add the cases from this issue as additional unit tests. |
@DanielRuf Still I couldn't resolve this issue
`import Tribute from "tributejs"; var tribute = new Tribute({ tribute.default is not a constructor error is throwed(Above mentioned issue) When I use src the below mentioned issue occured. My nodeModule tribute folder structure like below Can you clarify how to solve this error ? |
Don't use this. Use You may have the 3.7.3. Try 3.7.2: |
@gunak50 can you check what the right import statement for 3.7.3 is? It should work by default. |
Here it says it can not find |
@mrsweaters isn't the src folder needed for the ES6 version? Because browserify is for the browser, not NodeJS. |
No description provided.
The text was updated successfully, but these errors were encountered: