Giter Club home page Giter Club logo

Comments (10)

ALPIXELMaiki avatar ALPIXELMaiki commented on May 18, 2024 1

Not again :(

But after a search, i found it : http://stackoverflow.com/questions/20534702/node-js-use-of-module-exports-as-a-constructor

Since you can attach a function directly to module.exports you can essentially return a function and like any function it could be managed as a constructor

So i tried to modifiy your dist file by adding (at the very end) :
module.exports = o;window.Tippy=o
AND IT WORKS.

So, in your source code, i think you have to write this :
(in src/js/tippy.js, at the very end of the file)

module.exports = Tippy
window.Tippy = Tippy

Add the module.exports line, compile and submit a v0.5.0 :)

Regards,

from tippyjs.

ALPIXELMaiki avatar ALPIXELMaiki commented on May 18, 2024

I have the same error :

My directive file :

import Tippy from 'tippy'
window.Tippy = Tippy

TypeError: _tippy2.default is not a constructor

from tippyjs.

atomiks avatar atomiks commented on May 18, 2024

I'm switching to Rollup for bundle generation for v0.4.0 so it might solve the issue...

from tippyjs.

ALPIXELMaiki avatar ALPIXELMaiki commented on May 18, 2024

Thanks !
So I'll wait for v0.4.0 👍

from tippyjs.

atomiks avatar atomiks commented on May 18, 2024

v0.4.0 is out now... give it a try

from tippyjs.

ALPIXELMaiki avatar ALPIXELMaiki commented on May 18, 2024

Not :(

Always the same error...
import Tippy from 'tippy.js' always returns _tippy2.default is not a constructor

from tippyjs.

atomiks avatar atomiks commented on May 18, 2024

Maybe try import { Tippy } from 'tippy.js'?

from tippyjs.

atomiks avatar atomiks commented on May 18, 2024

I had that in v0.3.5, but with Rollup it broke when using the browser version so I removed it, lol

The browser version works too if I do export default class Tippy { ...

I solved it... need to export it from the main.js Rollup entry file, I believe

from tippyjs.

atomiks avatar atomiks commented on May 18, 2024

v0.4.1 should work now, can you test it out?

from tippyjs.

ALPIXELMaiki avatar ALPIXELMaiki commented on May 18, 2024

It works now :)

Thanks for your work !

from tippyjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.