Skip to content

Has no default export #1

Closed
Closed

Description

@503geek

I've followed the steps in the readme exactly, I've tried re-installing with npm, manually adding the @types module and using yarn instead of npm.

I'm using Angular 8, Node 12 and Npm 6. It seems no matter what I do I get the following error:

ERROR in node_modules/zingchart-angular/lib/zingchart-angular.component.d.ts(3,8): error TS1192: Module '"[...obfuscated...]/node_modules/@types/zingchart/index"' has no default export.

Line 3 in question, which shows a compiler error, is import zingchart from 'zingchart'; and points to the @types file, same as the above error.

I've tried various fixes to handle this, including writing my own .d.ts file what I understand to be a default export, but to no avail. I've also tried using different styles of imports (i.e. import * as ZingchartAngularModule or import { ZingchartAngularModule })

I'm not a seasoned Angular dev, so I may just need to get more familiar with how to resolve these errors in general, and how the structure of declared exports works, but this still seems like a gap in the installation instructions. zingchart-angular appears to have an ambiguous dependency on the zingchart module. Though the core of the issue appears to be in the @types module, and which yarn installs automatically, but npm does not. The fundamental issue is evading me at the moment, and I'm not sure how to proceed.

Activity

  1. 503geek commented on Feb 26, 2020

    @503geek
    Author

    FWIW this is using the free MBD Angular Admin Dashboard as a starter - I tried it using the MDB Vue starter and was able to get it working.

  2. mike-schultz commented on Feb 27, 2020

    @mike-schultz
    Contributor

    Hi @503geek , I actually did not see that @types accepted my pull request for the type definition file! It was stuck in review for weeks due to the sheer size of it. I'll look into updating that. In the meantime, I released this package with a local typedef file in src/. Can you see if that works for you?

  3. 503geek commented on Mar 1, 2020

    @503geek
    Author

    Thanks for the reply Mike. I still see zingchart-angular@0.0.6 as the latest. I tried reinstalling, same error, then tried removing the what might've been the old @types folder and reinstalling, same error. I have a feeling I'm trying to update/install the wrong package.

  4. PatrykTucki commented on May 17, 2020

    @PatrykTucki

    @mike-schultz please have a look on #2.

  5. jeanettephung commented on Aug 21, 2023

    @jeanettephung
    Contributor

    Latest version of @types/zingchart resolves this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions